1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

<Appium> find_element_by_* commands are deprecated. Please use find_element() instead

Posted at

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")
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?