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.txtand each site's terms of service before scraping. - Add a
delaywhen 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
Metadata
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| facrawlio-0.2.0.tar.gz | 4.5 kB | Without provenance | Details for facrawlio-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| facrawlio-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for facrawlio-0.2.0-py3-none-any.whl |
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
|
Security for facrawlio 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.