使用selenium webdriver和PhantomJS无法完全加载登录页面

时间:2013-09-05 15:22:47

标签: python selenium phantomjs

我正在尝试使用Python selenium webdriver和PhantomJS访问WSJ登录页面。

from selenium import webdriver
driver = webdriver.PhantomJS()
driver.get("https://id.wsj.com/access/pages/wsj/us/login_standalone.html")
driver.save_screenshot('login.png')

出于某种原因,它从未像我在屏幕截图中看到的那样完全加载:它没有CSS,可能没有加载Javascript。这可能是我登录无效的原因。

我不知道如何调试它,或者如何确保其他内容被加载。当我在Firefox webdriver中使用它时,它看起来很好,我可以登录。

有什么想法吗?使用硒2.35,phantomjs 1.9.1

1 个答案:

答案 0 :(得分:1)

试试这个:

driver = webdriver.PhantomJS(service_args=['--ignore-ssl-errors=true'])

赞美: ashemedai于2013年8月9日发表评论 在:https://github.com/detro/ghostdriver/issues/233

相关问题