Skip to main content

RobinWould

Spend time thinking, not coding. Scrape data with RobinWould

Test Coverage Package version

Introduction

RobinWould is framework for fast and easy development on web scraping tools based. With less than 10 lines of code you already have script ready to fish for data on the web.

Requirements

  • Python 3.8+
  • aiohttp
  • Scrapy

Installing

pip install robinwould

Example

Create it

Create a main.py with:

from robinwould import Crawler, fields, interfaces

class DataToScrape(interfaces.Model):
    foo = fields.StringField()
    bar = fields.IntegerField()

crawler = Crawler()

@crawler.spider(url="https://www.example.com/")
def mrs_spider(response):
    yield DataToScrape(
        foo='//div[@class="foobar-wrapper" and position()=1]/p[@class="foo"]/text()',
        bar='//div[@class="foobar-wrapper" and position()=1]/p[@class="bar"]/text()'
    )
    
if __name__ == '__main__':
    crawler.run()

Run it

Run the script with:

  • On Windows:
python main.py
  • On Linux or MacOS:
python3 main.py

Check it

If the spider worked, it should print the scraped data as the follow:

Data scraped: {'foo': 'Foo data', 'bar': 2}

You just created an script that:

  • Downloads the source file from https://www.example.com/;
  • Scraped the foo and bar data;

The crawler.run() method returns all the scraped data, so if you want to write the data into a file, just assign it to a variable and process it.

More information

I'm so sorry for not being able to deliver all the information you may need, I'll be working on a more complete documentation for future versions.

Licence

This project is licensed under the terms of the MIT license.

Metadata

Release files for robinwould 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for robinwould 0.1.1
File Size Uploaded
robinwould-0.1.1.tar.gz 11.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for robinwould 0.1.1
File Interpreter ABI Platform
robinwould-0.1.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 19.3 kB

Release files / robinwould-0.1.1.tar.gz

Download URL robinwould-0.1.1.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
dc9482a28e2adde519cc0fc9fdd4ac1d6ca6b700c0e25c2a229fc5659ece4a72
BLAKE2b-256 checksum
How to use checksums
0f679992e879641e5c52a711fedb0c8ef29804078a78d2ab832b60d7a5ee3f0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.28.1

Release files / robinwould-0.1.1-py2.py3-none-any.whl

Download URL robinwould-0.1.1-py2.py3-none-any.whl
Size 8.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
bc947fc7d1cec643bc9b6f6b11440338e1973ddf1643eba4a4367e512619edd9
BLAKE2b-256 checksum
How to use checksums
2395371035eae0a281afa11be6489d71fc68318aa8beee6022f34516da4c15c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.28.1

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page