python自动化实现QQ邮箱登录

难错点:遗漏iframe标签 代码实现: from selenium import webdriver import time from selenium.webdrivermon.by import By from selenium.

难错点:遗漏iframe标签

代码实现:

from selenium import webdriver
import time
from selenium.webdrivermon.by import By
from selenium.webdrivermon.keys import Keys

url1 = "https://mail.qq"

#确保浏览器打开后不会关闭
option = webdriver.ChromeOptions()
option.add_experimental_option('excludeSwitches',['enable-automation'])
option.add_experimental_option("detach", True)

#配置浏览器驱动
driver = webdriver.Chrome(options=option)
driver.get(url1)
print("=======验证浏览器的基本控制=======")

#针对qq邮箱iframe阻止点击登录
def iframe_enter():
        print("1.qq邮箱iframe阻止点击账号密码登录...")
        time.sleep(2)
        #切换第一个iframe
        login_iframe = driver.find_element(By.CLASS_NAME,         "QQMailSdkTool_login_loginBox_qq_iframe")

发布者:admin,转转请注明出处:http://www.yc00.com/web/1754670312a5187885.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信