selenium 模拟鼠标滚轮,滚动到可见的选项


 

 

self.wrap_driver.move_to_element(locator=const_xpath.monitor_select)    #鼠标移动到某个区域
target = self.driver.find_element_by_xpath(const_xpath.insurance[1]) #下拉框中的目标元素
self.driver.execute_script("arguments[0].scrollIntoView(false);", target) #移动到下拉框中的目标元素,让selenium可以点击它。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM