Skip to content

Commit 4ef9a36

Browse files
committed
改正了登录知乎脚本的一个错误
1 parent 1771aba commit 4ef9a36

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/zhihuClient.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# @Author: LoveNight
44
# @Date: 2015-12-01 15:54:22
55
# @Last Modified by: LoveNight
6-
# @Last Modified time: 2015-12-01 16:13:38
6+
# @Last Modified time: 2015-12-14 17:42:04
77
import requests
88
import time
99
import json
@@ -75,12 +75,13 @@ def login(self, username, password):
7575
print("已打开验证码图片,请识别!")
7676
subprocess.call(self.captchaFile, shell=True)
7777
captcha = input("请输入验证码:")
78+
os.remove(self.captchaFile)
7879
# 发送POST请求
7980
data = {
8081
"_xsrf": _xsrf,
8182
"password": self.__password,
8283
"remember_me": "true",
83-
"phone_num": self.__username,
84+
self.__getUsernameType(): self.__username,
8485
"captcha": captcha
8586
}
8687
res = self.__session.post(self.__loginURL, data=data)

0 commit comments

Comments
 (0)