zoukankan      html  css  js  c++  java
  • Selenium学习笔记||十五、模拟鼠标停留事件


    1. 引用
    from selenium.webdriver.common.action_chains import ActionChains
    (ActionChains支持一连串的动作。例如: ActionChains(driver).move_to_element(mouse).ac1().ac2().perform()。最后要以perform结尾)

    2. 使用
    mouse = driver.find_element_by_xpath("//*[@id='zxnav_1']")
    ActionChains(driver).move_to_element(mouse).perform()
    from selenium import webdriver
    from selenium.webdriver.common.action_chains import ActionChains
    
    driver = webdriver.Chrome(r"D:webdriverchromedriver_73.0.3683.68.exe")
    driver.implicitly_wait(5)
    driver.get("https://www.vmall.com/")
    main_handle = driver.current_window_handle
    
    mouse = driver.find_element_by_xpath("//*[@id='zxnav_1']")
    ActionChains(driver).move_to_element(mouse).perform()
    
    input("...")
    driver.quit()

  • 相关阅读:
    jstat命令-帮助优化java性能
    使用nginx搭建简单文件服务器
    JVM初探
    fastDFS shiro权限校验 redis FreeMark页面静态化
    spring AOP
    Java多线程并发
    js插件之Ocupload
    Jquery总结
    shell
    Linux(二)
  • 原文地址:https://www.cnblogs.com/Lixinhang/p/10943623.html
Copyright © 2011-2022 走看看