3
安装selenium
pip install selenium
使用selenium模拟登陆163邮箱
from selenium import webdriver
import time
#浏览器对象
driver = webdriver.Chrome()
#发请求
driver.get(‘https://mail.163.com/’)
time.sleep(3)
driver.switch_to.frame(0)
emailid= drive.find_element_by_name(‘email’)
emailid.send_keys(id)
emailpwd = driver.find_element_by_name(‘password’)
#密码输入框
emailpwd.send_keys(‘pwd’)
login = driver.find_element_by_id(‘dologin’)
#登陆按钮
login.click()
#点击按钮
IP相关知识