Skip to content

Commit 1c8e291

Browse files
committed
udpate
2 parents ff9e25e + 1be7d93 commit 1c8e291

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

pdf/crawler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def parse_body(self, response):
143143
pattern = "(<img .*?src=\")(.*?)(\")"
144144

145145
def func(m):
146-
if not m.group(3).startswith("http"):
146+
if not m.group(2).startswith("http"):
147147
rtn = "".join([m.group(1), self.domain, m.group(2), m.group(3)])
148148
return rtn
149149
else:

zhihu/auto_login.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@
2020

2121
# 使用登录cookie信息
2222
session = requests.session()
23-
# session.cookies = cookiejar.LWPCookieJar(filename='cookies')
24-
# try:
25-
# session.cookies.load(ignore_discard=True)
26-
# except:
27-
# print("还没有cookie信息")
23+
session.cookies = cookiejar.LWPCookieJar(filename='cookies.txt')
24+
try:
25+
print(session.cookies)
26+
session.cookies.load(ignore_discard=True)
27+
28+
except:
29+
print("还没有cookie信息")
2830

2931

3032
def get_xsrf():
@@ -70,6 +72,8 @@ def login(email, password):
7072

7173

7274
if __name__ == '__main__':
73-
74-
password = "lzjun854979"
75+
76+
if __name__ == '__main__':
77+
email = "xxxx"
78+
password = "xxxxx"
7579
login(email, password)

0 commit comments

Comments
 (0)