Skip to main content

facrawlio

Easy one-function web scraping — pull data from any page and save it straight to CSV or JSON.

Install

pip install -e .

(or, once published: pip install facrawlio)

Quick start

from facrawlio import scrape

# Scrape into CSV
data = scrape(
    url="https://example.com/products",
    selector=".product-card",      # the repeating element for each item
    fields={
        "title": "h2",
        "price": ".price",
        "link": "a::attr(href)"    # use ::attr(x) to grab an attribute
    },
    output="products.csv"
)

# Same call, just change the output filename to get JSON instead
data = scrape(
    url="https://example.com/products",
    selector=".product-card",
    fields={"title": "h2", "price": ".price"},
    output="products.json"
)

print(data)  # list[dict] — also written to the output file

No fields? Just grab text

from facrawlio import scrape

headlines = scrape(
    url="https://example.com/news",
    selector="h2.headline",
    output="headlines.json"
)
# [{"text": "..."}, {"text": "..."}, ...]

Parameters

Param Type Description
url str Page to scrape
selector str CSS selector for each repeating item
fields dict {column_name: sub_selector}; use ::attr(name) for attributes
output str Filename ending in .csv or .json; None to skip saving
method str "GET" or "POST"
headers dict Extra request headers
params dict URL query params
data dict POST form data
timeout int Request timeout in seconds (default 10)
delay float Seconds to sleep before requesting (basic rate limiting)
return_data bool Return the scraped list (default True)

Notes

  • Respect robots.txt and each site's terms of service before scraping.
  • Add a delay when scraping multiple pages in a loop to be polite to servers.
  • This library only fetches static HTML — it does not execute JavaScript. For JS-heavy sites you'll need a browser-based tool like Selenium or Playwright.

License

MIT

Release files for facrawlio 0.1.0

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

Source distribution (sdist)

Source distribution for facrawlio 0.1.0
File Size Uploaded
facrawlio-0.1.0.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for facrawlio 0.1.0
File Interpreter ABI Platform
facrawlio-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.2 kB

Release files / facrawlio-0.1.0.tar.gz

Download URL facrawlio-0.1.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ce2a5abfa6a9cded3448138b0adeeb570eeeb8ca802ad879286e23ddbc04e1a7
BLAKE2b-256 checksum
How to use checksums
3985b70c2bd2308bf9779acd094370b9e41994c9a6837b9bf9944996ec1bab2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / facrawlio-0.1.0-py3-none-any.whl

Download URL facrawlio-0.1.0-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23cdc2cab2153eeda7e764b5fa295e236f04b812f0b4594a8e65cd943bc8a5c2
BLAKE2b-256 checksum
How to use checksums
77ad7bcd5d78d45ba14a1f0bf2b30c6e9dc460065cf09c1eb11152b420119ad0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.0 This release

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