Giter Site home page Giter Site logo

lxf_archive's Introduction

lxf_archive

In issue 309 of LinuxFormat, a scraping tutorial claims to scrape their archive in only 70 lines of code. Unfortunately, it uses Requests and Beautiful Soup, fine libraries for making http requests and parsing HTML, but collectively NOT a scraping framework.

Mere parsing of HTML is neither sufficient or necessary for web-crawling these days.

This repo uses Scrapy to extract the same data in 35 lines of code.

It's not just Scrapy's use of Xpath that makes it powerful.

A function-call that makes a request never parses it, so code is flatter by design. It's easier for novices to avoid bad code.

Want to be kind to your victims? Enable Autothrottle.

Save the data to a .csv with:

scrapy crawl lxf -o lxf_archive.csv 

(Or, save in .json format, or push to AWS S3, Scrapy does these things out-of-the-box.)

Scrapy does things by default that novices don't know they need, and things that experienced data-miners are too busy to implement.

Need headless-browsers? Try Splash or Selenium.

Need tests? Need failures to alert Slack? Try Spidermon.

Want to easily deploy your spiders? Try Scrapyd.

Need to monitor your spiders in real time? Try Scrapydweb.

You want rotating proxies or TOR? There's a Downloader Middleware for that.

It goes on...

Use the Right Tool for the Right Job.

(Apparently, this was sufficient to make "Letter Of The Month"...)

LXF LOTM

lxf_archive's People

Contributors

augeas avatar

Watchers

 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.