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.2.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.2.0
File Size Uploaded
facrawlio-0.2.0.tar.gz 4.5 kB Details

Built distribution (wheel)

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

Total release size: 9.2 kB

Release files / facrawlio-0.2.0.tar.gz

Download URL facrawlio-0.2.0.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
de9f45129f5ce082a7e6f1a471ac1b37247227a2c0bb5aee8e412437d170fe22
BLAKE2b-256 checksum
How to use checksums
94af65edcc25af0fc4daf66c0c23bfd1247b67f7e5b3565ea35075ce99767421
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.2.0-py3-none-any.whl

Download URL facrawlio-0.2.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bfbde7ab4fbb53efc4ddbc9cb72d6ed8af2136a0d8ccb6ac4eb93d85137763ee
BLAKE2b-256 checksum
How to use checksums
a65d4f1fd2b9fea8d25a81bd66f7e3d96d4c02f7050d41744a8289f553a557e4
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

This release

0.2.0 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