API for Scrapy spiders
Project description
Arachne provides a wrapper around your scrapy Spider object to run them through a flask app. All you have to do is setup your SPIDER_SETTINGS in the settings file.
Installation
You can install Arachne from pip
pip install -i https://pypi.python.org/pypi Arachne
Sample settings
This is sample settings file for spiders in your project. The settings file should be called settings.py for Arachne to find it and looks like this:
# settings.py file
SPIDER_SETTINGS = [
{
'endpoint': 'dmoz',
'location': 'spiders.DmozSpider',
'spider': 'DmozSpider'
}
]
Usage
It looks very similar to a flask app but since Scrapy depends on the python twisted package, we need to run our flask app with twisted:
from twisted.web.wsgi import WSGIResource
from twisted.web.server import Site
from twisted.internet import reactor
from arachne import Arachne
app = Arachne(__name__)
resource = WSGIResource(reactor, reactor.getThreadPool(), app)
site = Site(resource)
reactor.listenTCP(8080, site)
if __name__ == '__main__':
reactor.run()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Arachne-0.2.0.tar.gz
(5.8 kB
view details)
File details
Details for the file Arachne-0.2.0.tar.gz.
File metadata
- Download URL: Arachne-0.2.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8dd4989e507d88ae2aa12d90db92708784bd64e79ce9640a9704aed851bf68ba
|
|
| MD5 |
927da9dcbd345a6a780f87a09b9c6a80
|
|
| BLAKE2b-256 |
7b3afbbfe0b231ebd686ccf1421996c8fe4e023fb2d023c5d8ee77d9540fe7af
|