8000 update user_agent to crawl · JeeeunOh/basic-algo-lecture@1fa4258 · GitHub
[go: up one dir, main page]

10000
Skip to content

Commit 1fa4258

Browse files
update user_agent to crawl
1 parent c42beea commit 1fa4258

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

workbook/actions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ def parse_category():
1616
return category
1717

1818
def get_problem_info(workbook_url):
19-
txt = requests.get(workbook_url).text
19+
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36'}
20+
txt = requests.get(workbook_url, headers=headers).text
2021
pattern = '/problem/'
2122
ret = []
2223
while True:

0 commit comments

Comments
 (0)
0