Giter VIP home page Giter VIP logo

scrash-pageuploader's Introduction

Scrash Page Uploader

A set of Scrapy pipelines that provide easy way to store html and screenshots rendered by Splash service. Each upload is non-blocking, so it won't slow down crawling process significantly.

Note: Only S3 storage is supported at the moment.

Pipelines

In order to store your HTML or PNG in S3 you must enable correspoding pipelines in settings.py (assuming you have package installed):

ITEM_PIPELINES = {
	...
	'pageuploader.html.UploadHtmlPipeline': 700,
	... and/or ...
	'pageuploader.screenshots.UploadScreenshotsPipeline': 700,
	...
}

Items

To support page/screenshot uploading you must define 4 additional fields in your items:

Input fields (will be deleted after upload):

  • html: contains HTML string to store
  • screenshot: contains PNG screenshot binary string to store

Output fields (will be populated with S3 urls):

  • html_url: contains URL of stored HTML file
  • screenshot_url: contains URL of stored PNG file

Configuring

If you have no S3 credentials set in Scrapy, you must set them in settings.py

AWS_ACCESS_KEY_ID = '<my key id>'
AWS_SECRET_ACCESS_KEY = '<my secret>'

Next, please set S3 bucket and path (expressed by single URI) where assets will be stored

S3_HTML_PATH = 's3://bucket-name/prefix1/
S3_SCREENSHOTS_PATH = 's3://bucket-name/prefix2/

Note: Please end URIs with trailing /

Tests

To run tests, you have to type it in console when you are in the project directory:

tox

scrash-pageuploader's People

Contributors

shirk3y 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.