【发布时间】:2016-11-19 22:38:42
【问题描述】:
我在 iframe 中有一个 hidden 类型的元素。我想知道在我使用硒时是否有任何方法可以获得这个值。更具体地说,它是一个验证码字段。我试过用
#!/usr/bin/env python
from selenium import webdriver
driver=webdriver.Chrome(chrome_bin_path)
driver.get('http://websitehere.com')
print driver.find_element_by_xpath('//*[@id="recaptcha-token"]').text
但由于它的隐藏性质,它什么也不返回。
下面是源码的sn-p。 突出显示的是感兴趣的字符串。 (价值)
【问题讨论】:
-
你可以看看this的问题。也许它可以帮助你。
标签: python html selenium captcha recaptcha