user3522371
user3522371

Reputation:

Selenium with python bindings launches Firefox but not Explorer and Chrome browsers

I want to launch Internet Explorer (8) browser on Windows XP SP3 using selenium. I coded these lines:

from selenium import webdriver
class InternetExplorer8:
    def ie8(self):
        self.browser=webdriver.Ie()
        self.browser.get("http://www.begueradj.com")
if __name__=='__main__':
    IE=InternetExplorer8()
    IE.ie8()

I got this error:

self.iedriver.start() File "C:\Python34\lib\site-packages\selenium\webdriver\ie\service.py", line 73, in start and read up at http://code.google.com/p/selenium/wiki/InternetExplorerDriver") selenium.common.exceptions.WebDriverException: Message: 'IEDriver executable needs to be available in the path. Please download from http://selenium-release.storage.googleapis.com/index.html and read up at http://code.google.com/p/selenium/wiki/InternetExplorerDriver

Note that I launch firefox without any problem using the same code, except internet explorer and crhome (that outputs a similar error). How could I resolve this problem ?

Upvotes: 1

Views: 1482

Answers (1)

alecxe
alecxe

Reputation: 474171

You need to download Internet Explorer driver and place the path to it into PATH environment variable.

Or, alternatively, provide an executable_path argument to webdriver.Ie():

self.browser = webdriver.Ie(executable_path='path\to\iedriver\driver.exe')

Upvotes: 2

Related Questions