zoukankan      html  css  js  c++  java
  • Markdown使用--代码块的折叠

    <summary>折叠代码块使用</summary>
    
    以selenium操作鼠标悬浮为例
    
    '''
    summary:折叠语法展示的摘要
    details:折叠语法标签
    pre:以原有格式显示元素内的文字是已经格式化的文本。
    blockcode:表示程序的代码块。
    code:指定代码范例。
    '''
    import time
    from selenium.webdriver import ActionChains
    from selenium import webdriver
    def hover_a(driver):
        driver.get('https://www.taobao.com/?spm=a2e15.8261149.1581860521.1.849529b4gvVaod')
        # ul_obj = driver.find_element_by_class_name('service-bd')
        li_list = driver.find_elements_by_class_name('J_Cat')
        # print(len(li_list))
        for li in li_list:
            time.sleep(2)
            ActionChains(driver).move_to_element(li).perform()
            # 鼠标悬浮一定记得perform()存储动作,可以理解为提交动作
    
        return '移动鼠标通过悬浮获取弹框完毕'
    if __name__ == '__main__':
        driver_obj = webdriver.Chrome()
        driver_obj.implicitly_wait(10)
    
        try:
            ret = hover_a(driver_obj)
            print(ret)
    
        except Exception as e:
            print(e)
        finally:
            print('5s后程序自动关闭')
            time.sleep(5)
            driver_obj.quit()
    
    
  • 相关阅读:
    常用Dos 命令
    Expect: 100continue
    Sql Server 文件和文件组体系结构
    Build Action
    regasm.exe 程序集注册工具
    获得user account的SID,GUID
    sp_change_users_login
    Regsvr32
    ASP.NET IIS 注册工具 (Aspnet_regiis.exe)
    随机生成300道四则运算
  • 原文地址:https://www.cnblogs.com/Guoxing-Z/p/12179904.html
Copyright © 2011-2022 走看看