0
我在iframe中有一个hidden
类型的元素。我想知道是否有任何方法可以得到这个值,因为我使用硒。更具体地说,它是一个验证码字段。我试过用一些东西拉它在Selenium中提取隐藏元素
#!/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
但由于它的隐藏性质,它什么都不返回。
以下是源代码片段。 突出显示的是感兴趣的字符串。 (值)
您可能需要查看[this](http://stackoverflow.com/questions/18500711/read-a-hidden-value-in-a-div-using-selenium-python-binding)问题。也许它可以帮助你。 – dazzieta