Coder Social home page Coder Social logo

scrapytest's Introduction

scrapytest

Simple test of the python Scrapy library (https://scrapy.org/), which allows you to retrieve and parse information from HTTP websites. In this case, I built a Django application with this features:

  • We store the different webpages we want to parse in a table (Media).
  • We created a management command to create some test media, called create_media. You can run that using python3 management.py create_media
  • This command inserts in the table 3 of the most important Spanish newspapers. The table contains the newspaper URL and the rule to get each article title.
  • We created another management command called launch_read_all, which creates a Scrapy Spider for each webpage, and launches a Crawler.
  • Each webpage in the Media table will result in a dynamic Spider type, that will read the articles titles in the page and will insert them into another table, called Articles

TODO:

  • Allow to filter articles by a topic, received as a parameter in the command.
  • Send the new articles over Slack, using the nice Slacker library (https://github.com/os/slacker)

scrapytest's People

Watchers

James Cloos avatar David Espí Hernández 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.