爬虫网易课堂

import requests
作者:小辉
herd={
    'accept': 'application/json',
    'accept-encoding': 'gzip, deflate, br',
   'User-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.25',
    'x-application-context': 'study-web:online:18362'
}
data={
    'activityId': 0,
    'keyword': "python",
    'orderType': 50,
    'pageIndex': 1,
    'pageSize': 50,
   'priceType': -1,
   'qualityType': 0,
   'relativeOffset': 0,
   'searchTimeType': -1,
    'searchType': 10,
}
url='https://study.163.com/p/search/studycourse.json'
rabzxcf_iop=requests.post(url,headers=herd,json=data).json()
asd=rabzxcf_iop['result']['list']

for i in asd:
# #          课程名                  教育机构      分数         人学过          图片            VIP多少钱   不是vip
      print(i['productName'],i['provider'],i['score'],i['learnerCount'],i['imgUrl'],i['vipPrice'],i['couponPrice'])

 

posted @ 2022-09-09 20:15  python,菜鸟  阅读(24)  评论(0)    收藏  举报