pip install selenium
https://sites.google.com/a/chromium.org/chromedriver/downloads
- Make sure the download matches chrome version
- Make sure you enabled the 'untrusted developer'
PATH = '/Users/adammcmurchie/2021/selenium/chromedriver'
driver = webdriver.Chrome(PATH)
Have:
- ID
- Class
- Name
- Tag
Most common is ID name and class name for grepping. Class is not unique so harder to search by
find_element_by_id
find_element_by_class_name
find_element_by_link_text
find_element_by_css_selector
find_element_by_tag_name
find_element by_xpath
find_elements_by_class_name
...
print(driver.page_source)