python - Python Selenium 不点击无法定位的链接
问题描述
这是网站: http: //money.finance.sina.com.cn/bond/quotes/sh175694.html
我试过了:
driver.find_element_by_xpath('//div[@class="title tit06"]/a').click()
或者
driver.find_element_by_xpath('(//a[@class="more more_links"])[1]').click()
两者都不起作用并返回:没有这样的元素:无法找到元素:
任何帮助将不胜感激!
谢谢!
这里还有更多:
url = 'http://biz.finance.sina.com.cn/suggest/lookup_n.php?country=&q=%09175708'
driver.get(url)
driver.implicitly_wait(10)
driver.find_element_by_xpath('(//div[@class="list"])[2]/label/a').click()
driver.implicitly_wait(10)
driver.find_element_by_xpath('//div[@class="title tit06"]/a').click()
解决方案
推荐阅读
- python - 为什么 A.issuperset(B) 比 all(b in A for b in B) 慢得多?
- macos - Finder 共享的 macOS 应用程序要求是什么,打开菜单
- c# - EF Core Linq 将 int 值更改为 -2147482646
- python - LUbuntu 20.02 PyCharm 没有名为 PIL 的模块
- python - 我不断收到 SyntaxError,我不知道为什么
- pointers - 如何构造指向某个字符串的唯一指针
- python - Django在登录时根据组重定向用户
- watchos - Apple 使用 watch os 模拟器登录
- javascript - 谁能修复我的 js textarea 限制特殊字符空间问题
- inno-setup - Inno 设置脚本:如何控制语言部分?