关于selenium自动点击找不到元素
above=browser.find_element_by_xpath("//a").click()
使用这个代码执行这个操作,可以执行
above=browser.find_element_by_xpath("//a").click()
同样的代码执行这个操作
NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"//a"}
(Session info: chrome=81.0.4044.138)
(Driver info: chromedriver=2.32.498550 (9dec58e66c31bcc53a9ce3c7226f0c1c5810906a),platform=Windows NT 10.0.18362 x86_64)
emmm请教各位大佬是什么原因阿 本帖最后由 1q23w31 于 2020-8-25 07:30 编辑
xpath无法定位元素
页面不存在这样的元素吧 "//a" 可以尝试先定位元素 再点击或者找图 把你的所有代码都发出来,不然我们无法判断真实的网页元素到底在不在。
页:
[1]