from selenium import webdriver

def openDriver():
global driver

    geckodriver_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'geckodriver.exe')
    driver = webdriver.Firefox(executable_path=geckodriver_path)
    
    driver.get('https://google.com/')
    return driver

def main():
driver= openDriver()

if __name__ == '__main__':
main()

I was using selenium==3.141.0 and urllib3 was 2.2.1 and when executing the script that should recognize the py path, it gave an execution error. It was then that I saw in another question that it could be the version of selenium or urllurllib3 It seems to be a problem with the specific version of Selenium when using executable_path

1

There are 1 best solutions below

0
oRafael_Pinheiro On

As per Selenium : ValueError: Timeout value connect was <object object at 0x0000011B792D8660>, but it must be an int, float or None. (python)

Need to downgrade urllib3 version to v1.26.18 Then it recognized the PATH of the current directory.

I verified that in version 4.18.1, by default, it already recognizes the PATH using driver = webdriver.Firefox()