Ask coding questions

← Back to all posts
How can I run selenium on this platform?
h
hvaandres

I have problems with my geckodriver since it is not recognizing the driver.

Voters
ColinBrereton
JasamritRahala
hvaandres
Comments
hotnewtop
LeonDoesCode

You need to move line 7, wait = WebDriverWait(driver, 10), to inside line 9, with webdriver.Firefox() as driver:. This is because line 9 is where you define the driver variable. You are getting the error because it doesn't exist until after line 9, but you are trying to use it on line 7.

hvaandres

@LeonDoesCode Thank you for the advice. However, the system doesn't recognize it.

LeonDoesCode

@AndresHaro1 The error that you are now getting is an indentation error. To fix this, remove one of the tabs befor the wait = ... line.

hvaandres

@LeonDoesCode I used VS code, and it seems that is working now!

LeonDoesCode

@AndresHaro1 Good to hear. Well, I hope it all works well from now on.