推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
wateryessence
V2EX  ›  Python

如何用爬虫爬取猫眼等网站上的电影信息?

  •  
  •   wateryessence · Sep 27, 2018 · 4691 views
    This topic created in 2784 days ago, the information mentioned may be changed or developed.

    学校要求的项目是从猫眼和豆瓣上抓取 2015 年至今的电影信息,爬取数据需包含但不限于电影名,电影题材,电影演员,电影导演,当前累计票房,上映时间。

    而且要求“数据爬取功能需满足登录用户在系统中输入一段时间,系统能够将时间段内爬取返还给用户”。

    需要用分布式爬虫吗?我是第一次接触 python 爬虫。不知道如何解决这些问题。

    5 replies    2018-09-29 17:47:15 +08:00
    raycool
        1
    raycool  
       Sep 27, 2018   ❤️ 1
    github 上找下,这个肯定有类似现成的轮子。
    ClutchBear
        2
    ClutchBear  
       Sep 27, 2018   ❤️ 1
    豆瓣有 api
    猫眼的关键数据用字体加密的.
    xiaozizayang
        3
    xiaozizayang  
       Sep 28, 2018   ❤️ 1
    先爬数据再处理给用户返回,比如时间段

    ![]( )
    locoz
        4
    locoz  
       Sep 29, 2018   ❤️ 1
    看了一下,猫眼的票房是有做字体加密的,如果是第一次写爬虫的话可能有点难度;豆瓣是入门级,无难度随便爬。
    “数据爬取功能需满足登录用户在系统中输入一段时间,系统能够将时间段内爬取返还给用户”这个需求的实现可以有两种方式:
    1、数据实时性要求较高的
    接口得到用户输入的时间段参数后再去爬,爬完格式化好了返回,缺点是速度可能较慢、容易触发反爬。
    2、数据实时性要求不那么高的
    爬虫和接口分开,爬虫每隔一段时间爬一次数据并存到数据库,接口得到时间段参数之后去查数据库就行了

    量少没必要分布式,拿 requests 写都行
    wc110302
        5
    wc110302  
       Sep 29, 2018
    自学,写了很多小网站爬虫,可以看一下 --> https://github.com/wc110302/My-spider
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   964 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 20:00 · PVG 04:00 · LAX 13:00 · JFK 16:00
    ♥ Do have faith in what you're doing.