zoukankan      html  css  js  c++  java
  • selenium3 qq登录frame操作

     1、登录QQ邮箱

          url='https://mail.qq.com/cgi-bin/loginpage'

    用户名,密码分别为u,p,login_button

    # _*_ coding:utf-8 _*_
    from selenium import  webdriver
    from selenium.webdriver.common.action_chains import  ActionChains
    import  time
    driver = webdriver.Chrome('C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe')
    driver.maximize_window()
    driver.get('https://mail.qq.com/cgi-bin/loginpage')
    time.sleep(5)
    
    driver.find_element_by_name('u').send_keys('2574674466')
    driver.find_element_by_name('p').send_keys('')
    driver.find_element_by_id('login_button').click()

    执行后-无法输入用户名,密码

    由于登录窗口有-frame,需要先切换-再执行

    需要加上:

    driver.switch_to.frame("login_frame")

    driver = webdriver.Chrome('C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe')
    driver.maximize_window()
    driver.get('https://mail.qq.com/cgi-bin/loginpage')
    time.sleep(5)
    driver.switch_to.frame("login_frame")
    driver.find_element_by_name('u').send_keys('2574674466')
    driver.find_element_by_name('p').send_keys('')
    driver.find_element_by_id('login_button').click()
    

      

  • 相关阅读:
    分解质因数
    大素数测试和分解质因数
    快速幂
    欧拉函数
    素数
    gcd,lcm,ext_gcd,inv
    凸包问题 poj 2187
    map的 简单用法
    判断线段是否在园内
    2-sat 问题
  • 原文地址:https://www.cnblogs.com/tim2016/p/7844742.html
Copyright © 2011-2022 走看看