Handling Redirection w/ PhantomJS + Selenium

后端 未结 3 2039
暖寄归人
暖寄归人 2021-01-06 10:34

I currently run browser tests via PhantomJS + Selenium in Python.

desired_capabilities = dict(DesiredCapabilities.PHANTOMJS)
desired_capabilities[\"phantomjs         


        
3条回答
  •  长情又很酷
    2021-01-06 11:10

    It turns out the page couldn't be crawled due an error: SSL handshake failed.

    The solution is to use the following line to initialize the driver:

    driver = webdriver.PhantomJS(executable_path="./phantomjs", service_args=['--ignore-ssl-errors=true'])
    

提交回复
热议问题