Python实现校园网自动登录脚本

547次阅读
没有评论
Python实现校园网自动登录脚本

#!/usr/bin/env python # -*- coding: utf-8 -*- from selenium import webdriver from selenium.webdriver.common.keys import Keys import time chrome_driver = "C:Program Files (x86)GoogleChromeApplicationchromedriver.exe" # 这一插件需要自己去网上下载,然后放在Chrome安装的对应路径 driver = webdriver.Chrome(executable_path=chrome_driver) driver.get("http://172.30.16.34/srun_portal_pc.php?ac_id=18&cmd=login&switchip=173.30.12.248&mac=70:1c:e7:31:e2:41&ip=10.138.119.79&essid=WHUT-WLAN&apname=JB-YQ-TSG-2F6A-C&apgroup=WHUT-JXBG-YQ-AG&url=http%3A%2F%2Fjwc%2Ewhut%2Eedu%2Ecn%2F");# 这里是你自己学校校园网登陆页面的URL # 输入用户名 driver.find_element_by_name("username").send_keys("248343")# 通过name获取输入框,并输入账号 # 输入密码 driver.find_element_by_name("password").send_keys("*********") # 模拟点击登录 driver.find_element_by_id("action_login").click() driver.quit()

 

神龙|纯净稳定代理IP免费测试>>>>>>>>天启|企业级代理IP免费测试>>>>>>>>IPIPGO|全球住宅代理IP免费测试

相关文章:

版权声明:Python基础教程2022-11-22发表,共计760字。
新手QQ群:570568346,欢迎进群讨论 Python51学习