webdriver.Firefox doesn't work as expected. it hangs at about:blank

373 views
Skip to first unread message

nhtrader

unread,
Sep 6, 2016, 11:24:27 PM9/6/16
to Selenium Users
firefox v 28.0.2
python v3.5.2
selenium v2.53.6 (I ran pip install -U selenium and it states that it is updated)
windows 10 home version 1511 build 10586.545


I can't get this simple python code to work.

when I run this code an instance of firefox opens but it does not goto to the webpage that I defined
it just hangs at "about:blank&utm_content=firstrun"

Why doesn't this work?

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException

webpage = "http://finance.yahoo.com"
browser = webdriver.Firefox()
browser.get(webpage)


BTW, I tried using other webbrowsers:
webdriver.Opera() - failed.
webdriver.Edge()  - success only after downloading and installing MSFT's MicrosoftWebdriver.msi
I do not have chrome installed on this PC so I didn't try webdriver.Chrome()


Shawn McCarthy

unread,
Sep 6, 2016, 11:29:09 PM9/6/16
to Selenium Users
Isn't Firefox 28 pretty old? Maybe try a newer version ?

nhtrader

unread,
Sep 7, 2016, 8:05:08 AM9/7/16
to Selenium Users
Sorry about the typo, I'm using the latest Firefox 48.0.2

Shawn McCarthy

unread,
Sep 7, 2016, 12:06:00 PM9/7/16
to Selenium Users
I believe (I can be wrong) that firefox 48 requires geckodriver, https://github.com/mozilla/geckodriver/releases . I assume you are not using GeckoDriver ?

See https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver as well

nhtrader

unread,
Sep 7, 2016, 7:25:28 PM9/7/16
to Selenium Users
As a newbie to both python and selenium, I did not know that I needed an extra file. So thanks for clarifying this point.

So I downloaded the geckodriver.zip and expanded it. And I moved it to a folder that already exists in my path (C:\program files\python35). And now I can use Firefox - it works!

But I have to add that it didn't work right out of the box b/c I had to debug a file that came with an upgrade to selenium 3.0.0b2. Selenium failed due to and error in one file (poor indentation). Once I corrected the indentation, then selenium was able to open firefox.

It's been a struggle, but it is now working.
Thanks.
Reply all
Reply to author
Forward
0 new messages