def news_crawler():
recommend_list = []
url = "https://www.infoq.cn/public/v1/article/getIndexList"
r = requests.get(url)
r.encoding = 'utf-8'
r_json = r.json()
r_json = r_json['data']['recommend_list']
for i in range(len(r_json)):
title = r_json[i]['article-title']
module = 2
author = r_json[i]['author']['nickname']
browse_time = 0
preference = 1
abst = "Lorem ipsum dolor sit amet, consectetur adipisicin..."
uuid = r_json[i]['uuid']
content = get_news_content(uuid)新手练习,想用python爬取infoq网站的新闻,但发现他们的网站,明明是不同的文章,但加载的时候xhr链接(上述代码中的url变量)是一样的?这样的话它们怎么区分不同的文章?
添加回答
举报
0/150
提交
取消