Python: Selenium with PhantomJS empty page source Python: Selenium with PhantomJS empty page source python python

Python: Selenium with PhantomJS empty page source


by default phantomjs use SSLv3, but many sites after bug in ssl migrate to tls. That's why you has blank page. use service_args=['--ignore-ssl-errors=true', '--ssl-protocol=any']

browser = webdriver.PhantomJS('phantomjs-1.9.7-windows\phantomjs.exe', service_args=['--ignore-ssl-errors=true', '--ssl-protocol=any'])


Using service_args=['--ignore-ssl-errors=true'] did the trick !

browser = webdriver.PhantomJS('phantomjs-1.9.7-windows\phantomjs.exe', service_args=['--ignore-ssl-errors=true'])


driverPhantom = webdriver.PhantomJS(driverLocation, service_args=['--ignore-ssl-errors=true', '--ssl-protocol=any'])      # initaling web driver for PhantomJs

Worked for me.