0

I had a problem running executing a Webdriver using a script in python using the library selenium. I have posted the sample code scenarios as well as the corresponding error thrown while executing.

Code Scenario:

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

driver = webdriver.Firefox()
driver.get("http://www.python.org")

Error Scenario:

Traceback (most recent call last):

  File "C:/Users/Kaushik/Desktop/IMC DEVELOPER TEST/Sample.py", line 4, in <module>
    driver = webdriver.Firefox()

  File "C:\Python27\lib\site-packages\selenium-2.37.2-py2.7.egg\selenium\webdriver\firefox\webdriver.py", line 59, in __init__
    self.binary, timeout),

  File "C:\Python27\lib\site-packages\selenium-2.37.2-py2.7.egg\selenium\webdriver\firefox\extension_connection.py", line 47, in __init__
    self.binary.launch_browser(self.profile)

  File "C:\Python27\lib\site-packages\selenium-2.37.2-py2.7.egg\selenium\webdriver\firefox\firefox_binary.py", line 60, in launch_browser
    self._start_from_profile_path(self.profile.path)

  File "C:\Python27\lib\site-packages\selenium-2.37.2-py2.7.egg\selenium\webdriver\firefox\firefox_binary.py", line 83, in _start_from_profile_path
    env=self._firefox_env).communicate()

  File "C:\Python27\lib\subprocess.py", line 709, in __init__
    errread, errwrite)

  File "C:\Python27\lib\subprocess.py", line 957, in _execute_child
    startupinfo)
WindowsError: [Error 87] The parameter is incorrect

I coudnt understand the Error thrown. I just need to use the selenium library to retrieve a dynamic data from a website using a python script.

1 Answer 1

5

There is nothing wrong with your code, it works fine for me.

Do you have firefox installed? if not, you can use a different browser. for example:

driver = webdriver.Ie 

or

driver = webdriver.Opera
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.