其他分享
首页 > 其他分享> > 爬虫网易课堂

爬虫网易课堂

作者:互联网

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'])

 

标签:网易,537.36,爬虫,application,json,rabzxcf,asd,课堂,105.0
来源: https://www.cnblogs.com/xxh12/p/16673879.html