selenium配合js定位元素(execute_script)之后,find_elements_by无法定位元素
execute_script("arguments[0].scrollIntoView()",)使用之后find_elements_by无法定位元素使用滚动定位之后返回父布局重新再进入frame进行定位即可实践可以看下面的githubhttps://github.com/BAICHEN123/QQ-摘要browser.execute_script("arguments[0].scrollIntoV
·
execute_script("arguments[0].scrollIntoView()",)使用之后find_elements_by无法定位元素
使用滚动定位之后返回父布局重新再进入frame进行定位即可
实践可以看下面的github
https://github.com/BAICHEN123/QQ-
摘要
browser.execute_script("arguments[0].scrollIntoView()",被点击的元素)
browser.switch_to.parent_frame()
browser.switch_to.frame(browser.find_element_by_css_selector("iframe.app_canvas_frame"))
更多推荐
已为社区贡献1条内容
所有评论(0)