Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium/Python:TypeError:undound method get()

I'm a new in Python with Selenium. I tried to test my first python/selenium code and got an error.

from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait # available since 2.4.0
import time

# Create a new instance of the Firefox driver
driver = webdriver.Firefox

# go to the google home page
driver.get("http://www.google.com")

Here, I've got the error:

**TypeError:unbound method get() must be called with Webdriver instance as first argument (got str instance instead)**

Anybody knows how to tackle this issue? Thanks in advance!

like image 294
alex Avatar asked Nov 20 '12 12:11

alex


1 Answers

You need () after webdriver.Firefox to actually call the class's constructor and create an instance.

like image 63
Wooble Avatar answered Oct 30 '22 13:10

Wooble