selenium利用js抓隐藏元素
元素抓取不到时通过控制台及检查元素查看是否获取有元
time.sleep(2)
driver.find_element_by_css_selector('#app > section > section > main > div > div.padding-middle.setting-area > div > div.tab-page.margin-left-large.border-radius-small > div.work-area-bgcolor.tab-containier > div > div.container.full-height > div.device-list.form-style.work-area-bgcolor.padding-middle > form > div:nth-child(2) > div.ant-col.ant-form-item-control-wrapper > div > span > div > div > div').click()
js = "return document.querySelector('#test-uuid > ul > li:nth-child(3)').innerText"
time.sleep(1.5)
driver.find_element_by_css_selector('#test-uuid > ul > li:nth-child(3)').click()
print(js)
text = driver.execute_script(js)
print(text)
代码什么的是青春最美的情书