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-alpha
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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9bf7a50abee70377086e2248fe06efaa505bea97ef7832572fdee6f021186e3 |
|
MD5 | e341643aa3759eade376c3c10ad5127c |
|
BLAKE2b-256 | 15fc3e7ef46161c7ca30e5beaf42f85c9b30659d7eaad77cf1a1ecdbc251ca91 |
Close
Hashes for script_scraper_alpha-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f25d5662f2a04dc2f71214d11c046f91d5b3155776f09ba5c1469cc39662af7 |
|
MD5 | d7ff0a86ed3504c1952f475929bfd223 |
|
BLAKE2b-256 | 3f71575fcaf81061d7ab52c33c451919daadf9a46913c34fa185be2d6bb763f1 |