1

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 ?

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176

1 Answers1

2

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')
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
  • May I disturb you by one additional question, Alexander ? I wonder why for Firefox browser I did not need to install a specific driver to launch it with selenium while I need so for IE ? –  Jul 22 '14 at 06:27
  • 1
    @begueradj yeah, this is how it works for any webdriver except Firefox. – alecxe Jul 22 '14 at 06:27
  • Howdy Alexander, do you have time to answer me this question please ? http://stackoverflow.com/questions/24887599/how-to-get-image-uri-in-selenium –  Jul 22 '14 at 15:21