M.Naveed
M.Naveed

Reputation: 1857

Firefox is not launching site

geckodriver does launch Firefox but firefox doesn't get url. Please see and point what's wrong with my function. would be great help as im very new to selenium and python

import selenium
from selenium import webdriver
from selenium.webdriver.common.keys import Keys

def Login(SiteUrl):
  driver = webdriver.Firefox()
  driver.get(SiteUrl)

if __name__ =="__main__":

 url = "www.google.com"

 Login(url)

Upvotes: 0

Views: 132

Answers (2)

Shubham Jain
Shubham Jain

Reputation: 17553

That simply means either your libs are old or Gecko binary is old. New gecko-libs are available now.

Download it from :

https://github.com/mozilla/geckodriver/releases

Download new version of selenium python libs from below URL:

https://pypi.python.org/pypi/selenium

Another thing as Martin point out

Add the protocol like http or https before passing URL

So use URL as :

url = "https://www.google.com"

Upvotes: 0

Ashish Mathew
Ashish Mathew

Reputation: 823

There could be multiple reasons -

  1. Try including HTTP protocol in the url i.e. - http://www.google.com

  2. You might be behind a proxy server. See this SO question -> Selenium WebDriver: Firefox starts, but does not open the URL & Selenium WebDriver.get(url) does not open the URL

  3. Your versions of the driver and the browser does not match.

Upvotes: 1

Related Questions