Git Product home page Git Product logo

xwlb's Introduction

说明

本项目的是将CCTV.com上的新闻联播历年的节目内容爬取到本地并解析。

本项目微博:今天追新闻联播了吗

抓取的思路为:

  • 首先找到当日新闻的入口(图1);
  • 其次在当日新闻的主页找到节目简介和节目详细内容的链接;
  • 最后解析节目简介和详细内容(图2和图3)。

图1:

图2:

图3:

网页保存路径:

  • xwlb/是本次节目的主页保存路径
  • xwlb/summarys/是本次节目的内容简介保存路径
  • xwlb/details/是节目中的详细内容保存路径

配置

1.安装mongodb

参考链接Ubuntu中安装mongodb

2.安装运行scrapy_splash

pip install scrapy_splash
docker run -p 8050:8050 scrapinghub/splash

运行

项目根目录执行:

cd xwlb/xwlb
scrapy crawl spider

注意

本项目的spalsh和mongodb使用的都是本机地址。如果是其他机器需要进行配置。 splash:修改setting.py文件中的SPLASH_URL=your ip mongodb:修改```/etc/mongod.conf中的:

# network interfaces
net:
  port: 27017
  bindIp: 0.0.0.0

xwlb's People

Contributors

lixiang0 avatar

Stargazers

Louis avatar  avatar  avatar Shaper avatar landv avatar  avatar Aha!! avatar shortwind avatar  avatar PhantomTide avatar  avatar 死亡随机 avatar  avatar  avatar

Watchers

James Cloos avatar  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.