diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..35410ca --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/ArchimondeXueXi.iml b/.idea/ArchimondeXueXi.iml new file mode 100644 index 0000000..786dd58 --- /dev/null +++ b/.idea/ArchimondeXueXi.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..13fecf3 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..7b6615a --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/main.py b/main.py index 381dbce..aff5877 100644 --- a/main.py +++ b/main.py @@ -1,12 +1,12 @@ """ 作者:Elli0t -2022.04.07 +更新于2022.05.06 如要运行需要修改三处代码 """ import requests import time import random -import re +import json courseUrl = "http://osscache.vol.jxmfkj.com/html/assets/js/course_data.js" @@ -25,8 +25,8 @@ 'Referer': 'http://osscache.vol.jxmfkj.com/html/h5_index.html' } responseCourse = requests.request("GET", courseUrl, headers=headers) -pattern = re.search(r'[0-9]', responseCourse.text) -courseNumber = pattern.group(0) +courseNumber = json.loads("{" + responseCourse.text.split("{")[2].split("}")[0] + "}")['id'] +# print(courseNumber) @@ -41,4 +41,4 @@ response = requests.request("POST", url, headers=headers, data=payload) print(peopleNumber) print(response.text) - time.sleep( random.randint(1,10) ) + time.sleep( random.randint(1,10) ) \ No newline at end of file