Provides a simple api interface with a scrapy backen for requesting complicated scraping tasks in an intuitive manner.
Project description
script-scraper: Intuitive queries for nested scraping tasks
What is it?
script-scraper is a Python package that provides a simple and intuitive interface, designed to make the web scraping procedure fast and modifiable. It aims to help developers in writing simple and interpretable bots. script-scraper is built on top of the Scrapy framework, providing the user with a familiar interface.
Where to get it
The source code is currently hosted on GitHub at: https://github.com/vlad-yeghiazaryan/script-scraper
You can also install it with pip, by running:
pip install script-scraper
Working example
from scriptScraper.extractors import ScriptRunner
request = {
"urls": ["https://quotes.toscrape.com"],
"extract_rules": {
"quotes": {
"selector": ".quote",
"type": "list",
"output": {
"text": ".text",
"author": ".author",
"tags": {
"selector": ".tag",
"type": "list"
},
"about": {
"selector": "span a",
"type": "page",
"follow": "href",
"output": {
"author_name": ".author-title",
"author_birth_date": ".author-born-date",
"author_birth_location": ".author-born-location",
"author_description": ".author-description"
}
}
}
}
}
}
crawler = ScriptRunner(delay=1, log=False, output='data.json')
scraped_data = crawler.scrape(request)
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
Built Distribution
Close
Hashes for script-scraper-alpha-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2598fe47364ea3c5cf5e754e439b59a28ca19654967aee56e2d3e67ee5a74d1f |
|
MD5 | 12e5058b1b1200232a97ccfae466aed4 |
|
BLAKE2b-256 | 7443a810f7c13c95bab9618c942e60c8a56f7421a1960d159c77d68280f6d629 |
Close
Hashes for script_scraper_alpha-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7147be90cf0ae72b4ae99d8e53932475104b3873c332a7fd4089c39d3dd3d607 |
|
MD5 | ccdcb1c792fc2f09a9e3c1009080f410 |
|
BLAKE2b-256 | 99977b6fbc1bd2aeeed788765e799af8fb53a11d451a360486a081700ad6f88b |