(ssg-wsg)有什么方法可以从api中获得完整的课程参考号吗

  • 本文关键字:参考 程参考 ssg-wsg 方法 api api
  • 更新时间 :
  • 英文 :


如标题所述,网站上有200000多门课程。。我使用了使用标记代码和日期的api,但只能从目录中提取大约400门课程。。。有没有办法获得所有的课程参考号?

下面是我的代码

tagging_codes=[30011,30012,30013,30021,30022,30031,30032,30033,30041,30042,30043,
30051,30052,30053,30061,30062,30063,30071,30072,30073,30081,30082,
30083]
full_list=[]
section=['directory?pageSize=20&page='+str(num+1)+'&taggingCodes='+str(i)+'&courseSupportEndDate=20201223&retrieveType=FULL' for num in range(20) for i in tagging_codes]
for i in section:
res=requests.get('https://public-api.ssg-wsg.sg/courses/'+i,headers={'Authorization':'Bearer '+token_value})
soup=res.json()
try:
data=soup['data']['courses']
except:
continue
for j in range(len(data)):
full_list.append(data_dict_maker(data,j))
# generate sleep
sleep_duration = random.randint(2,6)
print(sleep_duration, i, j)
time.sleep(sleep_duration) 

我检查了Retrieve Courses API的API响应有效负载,能够检索到20000多个课程,而不是您提到的400个课程。MySkillsFuture的课程搜索也显示了大约21000门课程。可以分享使用了哪些输入参数?

最新更新