3

Python爬虫编程思想(92):项目实战:抓取京东图书评价

 2 years ago
source link: https://blog.csdn.net/nokiaguy/article/details/121666473
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Python爬虫编程思想(92):项目实战:抓取京东图书评价

        本文实现的爬虫会抓取京东商城指定图书的评论信息。本例使用requests抓取图书评论API信息,然后通过json模块的相应API将返回的JSON格式的字符串转换为JSON对象,并提取其中感兴趣的信息。

        读者可以在京东商城选择一本图书,例如,《Python从菜鸟到高手》,URL是https://item.jd.com/12417265.html。商品页面如图1所示。

        在页面的下方是导航条,读者可以单击导航条上的数字按钮,切换到不同的页面,会发现浏览器地址栏的URL并没有改变,这种情况一般都是通过另外的通道获取的数据,然后将数据动态显示在页面上。现在的任务就是寻找这个通道的URL。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK