没有这样的元素例外。无法在 selenium python 中定位元素

新手开发

我想从https://www.archionweb.be/在这个页面https://www.archionweb.be/Public/Company/1930抓取电子邮件

电子邮件在验证码中受到保护,所以想法是点击验证码然后提取电子邮件。但是每当我尝试单击验证码按钮(我同时使用 XPath 和 CSS 选择器)时,就会出现异常:

“没有这样的元素:无法找到元素”

请如果有人可以帮助我。

帕马杜

由于我们即使在点击I am not a Robot之后也在自动化,有时会再次重新验证。能够点击带有以下代码的复选框。

from selenium import webdriver
import time
from selenium.webdriver.common.action_chains import ActionChains


driver = webdriver.Chrome(executable_path="path to chromedriver.exe")
driver.maximize_window()
driver.implicitly_wait(30)
driver.get("https://www.archionweb.be/Public/Company/1930")
time.sleep(5)
iframe = driver.find_element_by_xpath("//iframe[@title='reCAPTCHA']")
driver.switch_to.frame(iframe)
time.sleep(5)
recaptcha = driver.find_element_by_class_name("recaptcha-checkbox-borderAnimation")
driver.execute_script("arguments[0].scrollIntoView(true);",recaptcha)
ActionChains(driver).move_to_element(recaptcha).click().perform()
time.sleep(2)
driver.switch_to.default_content()

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

无法在 Python 中定位元素 - Selenium

Python Selenium没有这样的元素:移动到元素操作后无法使用xpath定位元素

selenium.common.exceptions.NoSuchElementException:消息:没有这样的元素:无法使用 Selenium 和 Python 定位元素

Python Selenium 定位元素

Selenium Webdriver(Python)-无法在嵌套iframe中定位元素

如何使用Selenium和Python在iFrame中定位元素

在selenium python中按文本查找后定位元素

Selenium无法定位元素(Python)

无法使用 Selenium Python 定位元素

无法使用Selenium Python定位元素

无法定位元素 _ Python Selenium

Python Selenium 无法定位元素

Selenium 没有这样的元素:无法定位元素(尝试登录)

Ruby - Selenium Webdriver - 没有这样的元素:无法定位元素:

Selenium webdriver 消息:没有这样的元素:无法定位元素 - iFrame

如何使用Selenium Python定位元素

消息:没有这样的元素:无法定位元素:{"method":"css selector","selector":"[id="username"]"} python 中的错误

消息:没有这样的元素:无法定位元素:{"method":"css selector","selector":"[id="username"]"} python 中的错误

Python中的Selenium错误-消息:没有这样的元素:无法找到元素

没有这样的元素:无法在Python / Selenium中找到ID为ID的元素

NoSuchElementException:消息:尝试使用Selenium和Python定位元素时无法定位元素

无法使用Python Selenium在shadow-root(open)中定位元素

Python中的Selenium显示无法使用xpath表达式定位元素

无法在 Python Selenium 中定位元素,但一切正常

没有这样的元素:无法在生产环境中使用chromedriver和Selenium定位元素

Selenium 消息:没有这样的元素:无法定位元素:不在 linux 服务器上工作

chromedriver selenium.common.exceptions.NoSuchElementException:消息:没有这样的元素:无法定位元素

selenium.common.exceptions.NoSuchElementException:消息:没有这样的元素:无法定位元素(XPath)

Python:Selenium“没有这样的元素” XPath或ID