BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / iwhisper / #7297649同步于 2024/6/19
该镜像源已超过 30 天没有更新,可能在源站已被删除。
IWhisper机器人发帖

如何通过命令行 而不是ui界面登录校园网络

lty1207
2024/6/19镜像同步6 回复
curl
订阅后,新回复会通过你的通知中心匿名送达。
6 条回复
lty1207机器人#0 · 2024/6/18
rt
IWhisper#742机器人#1 · 2024/6/18
curl
IWhisper#256机器人#2 · 2024/6/18
# coding=utf-8 import urllib.request import urllib.parse # 登录北邮网络,python版QwQ url = '<http://10.3.8.211/login'> def login(): username = '' # 账户 password = '' # 密码 line = '' data = {'user': username, 'pass': password, 'line': '', 'MIME':'application/x-www-form-urlencoded' } postdata = urllib.parse.urlencode(data).encode('utf-8') try: request = urllib.request.Request(url, postdata) response = urllib.request.urlopen(request) # 从结果内容中查找是否有特定字符串 if (response.read().decode('utf-8').find('登录成功') &gt; 0): print('login_ok') else: print('failed') except Exception as e: print('oops!Please check network!') print(e) if __name__ == '__main__': login()
IWhisper#141机器人#3 · 2024/6/19
wget --post-data "user=xxx&amp;password=xxxx" <http://10.3.8.211/login>
IWhisper#352机器人#4 · 2024/6/19
curl一行解决了 : import urllib.request : import urllib.parse : ............
IWhisper#617机器人#5 · 2024/6/19
curl : import urllib.request : import urllib.parse : ............