Created
January 9, 2024 16:47
-
-
Save vanleantking/13ba839488e55578b0ae5502dce843f9 to your computer and use it in GitHub Desktop.
xpath find grandparent node contains class name
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
xpath find grandparent node contains class name | |
elem_parent_btn_download = driver.find_element_by_xpath("(//span[contains(.,'Tải về danh sách')])[4]/ancestor::div[contains(@class,'download-button-dropdown')]") | |
xpath find chidld node: | |
child_element = element.find_element_by_xpath('./') | |
child_element = element.find_element_by_xpath('.//') | |
https://stackoverflow.com/questions/66166788/get-child-element-using-xpath-selenium-python | |
https://stackoverflow.com/questions/20216541/selenium-find-childs-child-elements | |
https://stackoverflow.com/questions/68385050/selenium-python-xpath-find-element-that-has-a-child-grandchild | |
https://stackoverflow.com/questions/43478965/find-out-all-child-elements-xpath-from-parent-xpath-using-selenium-webdriver-in | |
https://stackoverflow.com/questions/24795198/get-all-child-elements |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
find parent element by xpath on an element
elem_new_plan = driver.find_element(By.XPATH, "(//material-ripple[@aria-hidden='true'])[16]")
elem_btn_new_plan = elem_new_plan.find_element_by_xpath("..");