Equinox
Equinox

Reputation: 6748

Error in opening browser using selenium webdriver and python

This is my code

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

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

I am getting error

Traceback (most recent call last):
File "E:/codes/python/script.py", line 5, in <module>
driver.get("http://www.python.org")
TypeError: get() missing 1 required positional argument: 'url'

I referred the docs but there is not much info there

Upvotes: 3

Views: 11473

Answers (1)

Guy
Guy

Reputation: 50809

webdriver.Chrome() is constructor, not a field. It should be

driver = webdriver.Chrome()

Or

driver = webdriver.Chrome('/path/to/chromedriver')

Upvotes: 9

Related Questions