You can find a parent element by using ..
xpath:
parent_p = el.find_element_by_xpath('..')
或:
parent_p = el.find_element(By.XPATH, '..')
相關文章:
撰寫CSS選擇器(CSS Selector)
https://stackoverflow.max-everyday.com/2019/08/css-selector/
You can find a parent element by using ..
xpath:
parent_p = el.find_element_by_xpath('..')
或:
parent_p = el.find_element(By.XPATH, '..')
撰寫CSS選擇器(CSS Selector)
https://stackoverflow.max-everyday.com/2019/08/css-selector/