Last active
November 28, 2020 08:20
-
-
Save littleironical/c92e106c1e3a800bcabcf72406875f95 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Problem 1. 'chromedriver.exe' executable needs to be in PATH. | |
# First install webdriver-manager | |
pip install webdriver-manager | |
# Then import ChromeDriverManager | |
from selenium import webdriver | |
from webdriver_manager.chrome import ChromeDriverManager | |
# This will automatically update the driver | |
# No need to specify the path in this case | |
driver = webdriver.Chrome(ChromeDriverManager().install()) | |
... | |
### Problem 2. selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: | |
# This is a race condition where the 'find element' is executing before it is present on the page | |
# The line below will wait for 1 second and then continue the code | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment