"""
对话框处理
浮动的弹出对话框 如登录框或者其他功能的iframe
百度贴吧:
1.单击"登录"链接,弹出登录框
2.在登录框中单击"用户名登录"选项,显示真正的登录界面
3.填充账号和密码,单击"登录"按钮
"""
# -*- coding: utf-8 -*-
from selenium import webdriver
import time
from selenium.webdriver.common.by import By
data={
'url':'https://tieba.baidu.com/index.html',
'first_btn_classname':'u_menu_item',
'show_account_login_id':'TANGRAM__PSP_4__footerULoginBtn',
'usename_id':'TANGRAM__PSP_4__userName',
'password_id':'TANGRAM__PSP_4__password',
'login_btn_id':'TANGRAM__PSP_4__submit'
Selenium基础知识 自动登录百度贴吧
![](https://img-home.csdnimg.cn/images/20240711042549.png)