Python Selenium With Phantomjs - Click Failed: Referenceerror: Cant't Find Variable
Im writing a python script using selenium webdriver to get some data from a website, and Im trying to click the next button in this webpage. Where the button is defined:
Solution 1:
Try sending a different User-Agent header:
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
user_agent = (
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) " +
"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36"
)
dcap = dict(DesiredCapabilities.PHANTOMJS)
dcap["phantomjs.page.settings.userAgent"] = user_agent
browser = webdriver.PhantomJS(desired_capabilities=dcap)
Post a Comment for "Python Selenium With Phantomjs - Click Failed: Referenceerror: Cant't Find Variable"