MyCgDoc
MyCgDoc

Selenium

Documentation

Selenium with Python - Selenium Python Bindings 2 documentation

Note This is not an official documentation. If you would like to contribute to this documentation, you can fork this project in GitHub and send pull requests. You can also send your feedback to my email: baiju.m.mail AT gmail DOT com. So far 50+ community members have contributed to this project (See the closed pull requests).

selenium-python.readthedocs.io

Install process

Module

Like other modules, this can be installed with the following:

py -m pip install selenium

Gecko Driver

Selenium requires access to geckodriver, located here:

Release 0.28.0 · mozilla/geckodriver

macOS 10.15 (Catalina): Due to the requirement from Apple that all programs must be notarized, geckodriver will not work on Catalina if you manually download it through another notarized program, such as Firefox. Whilst we are working on a repackaging fix for this problem, you can find more details on how to work around this issue in the macOS notarization section of the documentation.

github.com

Release 0.28.0 · mozilla/geckodriver

Set Executable Path

Replace <path> with the actual path to the driver wherever it is saved to on disk.

from selenium import webdriver
driver = webdriver.Firefox(executable_path=r'<path>\geckodriver.exe')
driver.get("<weblink>")

Reference:

https://stackoverflow.com/questions/49929374/notadirectoryerror-winerror-267-the-directory-name-is-invalid-error-while-inv/49930067