Skip to content

使用Python requests 和 BeautifulSoup 开发爬虫。 抓取汽车之家中,汽车的基本信息(车型,品牌,报价等)

Notifications You must be signed in to change notification settings

William-Sang/autohome_crawler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

###项目简介

本项目主要用于介绍使用 requests 和 BeautifulSoup 进行爬虫开发,最后采集到的条目格式如下:

{
    "外观颜色": "晨露白,布里奇沃特青铜,马达加斯加橙,鲜绿,塞勒涅青铜,深蓝色,栗子黑", 
    "name": "Vanquish", 
    "url": "http://car.autohome.com.cn/price/brand-35.html", 
    "brand": "阿斯顿·马丁", 
    "车身结构": "硬顶跑车", 
    "变速箱": "自动", 
    "发动机": "6.0L", 
    "级别": "跑车", 
    "price": "526.88-628.00万"
}

使用须知

  1. clone 本项目
# git clone https://github.com/William-Sang/autohome_crawler.git
  1. 配置依赖

    # cd autohome_crawler
    # pip install -r requirements
    
  2. 修改配置(如果有需要)

    # vim setting.py
    
  3. 执行爬取任务,默认结果会下载到 requests 目录下

    # python app.py
    

需要加强功能

  1. 下载重试功能 http://www.coglib.com/~icordasc/blog/2014/12/retries-in-requests.html

可能出现的问题

  1. 抓取具体车型信息的时候,会出现颜色无法抓取成功的情况。(有时)

About

使用Python requests 和 BeautifulSoup 开发爬虫。 抓取汽车之家中,汽车的基本信息(车型,品牌,报价等)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages