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