刘仙er 发表于 2022-6-24 20:18:59

爬虫实战某通登录

本帖最后由 刘仙er 于 2022-6-24 20:21 编辑

> 本帖最后由 刘仙er 于 2022-6-24 20:21 编辑

# **python新手,大佬勿喷哈~如果碍您眼了,您可以看看论坛其他精华内容**
**代码仅供娱乐消遣,如果各位玩得开心**

```
import requests
a = input('请输入手机号:').strip()
b = input('请输入密码: ').strip()
#会话
session = requests.session()
headers = {
    'user-agent': 'ChaoXingStudy/ChaoXingStudy_3_2.0_ios_phone_201704021900 (iPhone; iOS 10.3.3; zh_CN)AppleWebKit/601.1.46_Mobile_0781620576655',
    'Host': 'mooc1-2.chaoxing.com',
    'Connection': 'keep-alive',
    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
    'Referer': 'http://i.mooc.chaoxing.com',
    }
data = {
    'uname': a,
    'password': b,
}

#登录
url = 'https://passport2.chaoxing.com/fanyalogin'
resp = session.post(url, data=data).text
if ('true' in resp):
    print('登陆成功')
else:
    print('账号或密码错误')

```

执念e1 发表于 2022-6-24 20:28:58

继续加油{:4_101:}{:4_101:}{:4_101:}

Ne-21 发表于 2022-6-24 20:31:46

ggnb!!!!!1

PLA888 发表于 2022-6-24 23:20:35

继续加油,测试能登陆成功。

陈公子的话 发表于 2022-6-25 09:06:56

ggnb

okki 发表于 2022-8-1 12:09:47

请问只有 python 实现这个功能吗?

脚本可以吗?

13728741411 发表于 2022-10-25 18:04:57

ggnb!!!

wantwill 发表于 2022-11-9 10:52:03

继续加油,测试能登陆成功
页: [1]
查看完整版本: 爬虫实战某通登录