Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium WebDriver.get(url) does not open the URL

from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverWait # available since 2.4.0 import time   # Create a new instance of the Firefox driver driver = webdriver.Firefox()   # go to the google home page driver.get("http://www.google.com") 

This opens a Firefox window but does not open a url.

  1. I have a proxy server(but the address bar does not show the passed url)
  2. I have two Firefox profiles.

Can 1 or 2 be an issue? if yes, then how can I resolve it?

like image 631
BrickByBrick Avatar asked Sep 08 '11 11:09

BrickByBrick


People also ask

What does driver get URL do?

Google's Answer: get() is used to navigate particular URL(website) and wait till page load. driver. navigate() is used to navigate to particular URL and does not wait to page load.

How does Selenium Store current URL?

Click on the “console” tab. In the console, type “document. URL” command and hit enter. You will give the current URL.


1 Answers

It is a defect of Selenium.
I have the same problem in Ubuntu 12.04 behind the proxy.

Problem is in incorrect processing proxy exclusions. Default Ubuntu exclusions are located in no_proxy environment variable:

no_proxy=localhost,127.0.0.0/8 

But it seems that /8 mask doesn't work for selenium. To workaround the problem it is enough to change no_proxy to the following:

no_proxy=localhost,127.0.0.1 

Removing proxy settings before running python script also helps:

http_proxy= python script.py 
like image 190
grdshch Avatar answered Sep 28 '22 10:09

grdshch