elem1=driver.find_element_by_css_selector('div.img-list-wrapper>div:nth-child(2)>img:nth-child(1)').get_attribute('src')
print(elem1)
转到iframe
iframe=driver.find_element_by_css_selector(".factory-detail>div>iframe")
driver.switch_to.frame(iframe)
转回到主
driver.switch_to.default_content()
selenium css 定位子元素
最新推荐文章于 2024-05-10 11:34:02 发布