find_element_by_idっていう書き方が非推奨?
これからはelement = driver.find_element(By.ID, "element_id")
インポートする
from selenium.webdriver.common.by import By
##ID
element = driver.find_element_by_id("element_id")
↓
element = driver.find_element(By.ID, "element_id")
class
element = driver.find_element_by_class_name("element_class")
↓
element = driver.find_element(By.CLASS_NAME, "element_class")
name
element = driver.find_element_by_name("element_name")
↓
element = driver.find_element(By.NAME, "element_name")
link_text
element = driver.find_element_by_link_text("element_link_text")
↓
element = driver.find_element(By.LINK_TEXT, "element_link_text")
tag_name
element = driver.find_element_by_tag_name("element_tag_name")
↓
element = driver.find_element(By.TAG_NAME, "element_tag_name")
css_selector
element = driver.find_element_by_css_selector("element_css_selector")
↓
element = driver.find_element(By.CSS_SELECTOR, "element_css_selector")
xpath
element = driver.find_element_by_xpath("element_xpath")
↓
element = driver.find_element(By.XPATH, "element_xpath")