Code Monkey home page Code Monkey logo

jd_spider's Introduction

京东爬虫

京东官网 - https://www.jd.com

Author Gobi Xu
Email [email protected]

声明

任何内容都仅用于学习交流,请勿用于任何商业用途。

前言

简单说明

  • 这是个demo,需要什么类目,什么字段请自行增减
  • 请求时不需要携带cookies(即不需要先登录),过程相对轻松
  • 需要爬取的数据通过请求地址携带参数即可得到

运行环境

Version: Python3

安装依赖库

pip install scrapy

细节

  • 商品列表页后半部分是异步加载的
商品列表页的每一页都有60个商品,但是请求商品列表页时,只会显示前30个商品,剩下的30个商品是下滑商品列表页时异步加载出来的,使用抓包的方法可以截取到剩下的30个商品的请求地址,请求地址尾部包含了前30个商品的商品id,头部信息里的Referer为商品列表页的请求地址

enter image description here

enter image description here

  • 请求地址的参数
商品列表页一共100页。第一页的请求地址中page参数为1,第一页的剩下30个商品的请求地址中page参数为2。第二页的请求地址中page参数为3,第二页的 剩下30个商品的请求地址中page参数为4....以此类推

类目

📞手机

爬取字段:

  • 商品id (id)
  • 商品标题 (title)
  • 商品详情页网址 (url)
  • 商品的网店名称 (shop_name)
  • 商品价格 (price)
  • 商品牌子 (brand)
  • 商品型号 (model)
  • 商品评论数量 (comment_count)
  • 商品好评数 (good_count)
  • 商品中评数 (general_count)
  • 商品差评数 (poor_count)
  • 商品展示数 (show_count)

最后

  • 对应的spider里有大量注释,请放心食用:meat_on_bone:
  • 对应的类目在items.py里
  • 如有任何问题都可以邮箱:email:联系我,我会尽快回复你。

jd_spider's People

Contributors

15920036578 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.