Selenium: How to Get Second-Level Div Elements in Python
To find all second-level div elements, you can modify the XPath expression to select the child div elements of the outer div. Here is the modified code:
div_elements = driver.find_elements(By.XPATH, "//body/div/div")
This will select all div elements that are immediate children of the outer div.
原文地址: http://www.cveoy.top/t/topic/lTof 著作权归作者所有。请勿转载和采集!