0

I'm trying to access a site with selenium which requires a login, but I haven't had luck and I've been reading forums all day.

Here's the code:

#!/usr/bin/python2.7

import selenium
from selenium.webdriver.common.by import By
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from pyvirtualdisplay import Display

display = Display(visible=0, size=(1024, 768))
display.start()

browser = webdriver.Firefox()

browser.get('https://www.centurylink.com/business/login/')

username = selenium.find_element_by_id("user")
password = selenium.find_element_by_id("password")

username.send_keys("xxxxxx")
password.send_keys("xxxx")

selenium.find_element_by_name("submit").click()

print browser.page_source

browser.quit()
display.stop()

and I'm getting this error:

File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 98, in _wait_until_connectable raise WebDriverException("The browser appears to have exited " selenium.common.exceptions.WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.

Would anyone please point me in the right direction?

Thanks!!

Colin Basnett
  • 4,052
  • 2
  • 30
  • 49
  • Have you tried running it without a virtual display so that you can observe what is happening? – Bryan Oakley Feb 29 '16 at 21:25
  • Is there a full stack trace with that? Is on a particular line, or before it gets anywhere? – Danny Staple Feb 29 '16 at 21:34
  • Possible duplicate of [How to fix Selenium WebDriverException: The browser appears to have exited before we could connect?](http://stackoverflow.com/questions/26070834/how-to-fix-selenium-webdriverexception-the-browser-appears-to-have-exited-befor) – Chanda Korat Feb 07 '17 at 09:23

0 Answers0