Ralk
Ralk

Reputation: 461

Selenium connection

I'm trying to get a webpage with Selenium with this code :

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

IEdriver= 'C:\Program Files\Internet Explorer\iexplore.exe'
browser = webdriver.Ie(IEdriver)
browser.get('www.google.com')

When IE is open, it tries to connect to :

http://--port=60803/

And I can't connect to Google. Does anyone know why ?

EDIT:

The exception is :

WebDriverException("Can not connect to the Se
selenium.common.exceptions.WebDriverException: Message:
ervice C:\Program Files\Internet Explorer\iexplore.exe

Upvotes: 0

Views: 90

Answers (1)

Andersson
Andersson

Reputation: 52665

You should add scheme (application layer protocol you want to use) to URL, so replace

browser.get('www.google.com')

with

browser.get('https://www.google.com')

Also there is another problem in your code:

IEdriver= 'C:\Program Files\Internet Explorer\iexplore.exe' points on IE browser binary file while webdriver.Ie() should get path to IEDriverServer.exe as value for executable_path parameter

Upvotes: 2

Related Questions