1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-06 16:01:41 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

update;修复国外版脚本失效;修改国内版力扣地址

This commit is contained in:
2022-05-02 23:30:08 +08:00
parent f3e61dc093
commit bc30d9a0a5
3 changed files with 9 additions and 7 deletions

View File

@@ -10,7 +10,9 @@ from bs4 import BeautifulSoup
def get_proble_set(url):
try:
response = requests.get(url)
response = requests.get(url, headers = {
'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Safari/537.36 Edg/101.0.1210.32"
})
if response.status_code == 200:
return response.text
return None