selectorprobe
pip install selectorprobe
Point it at one article and it tells you which CSS selector holds the body of that article, so you can paste it into the full text field of a feed reader instead of hunting for it in a browser inspector.
selectorprobe https://example.com/2026/09/harbour-wall-reopens
The report looks like this. The block below is the exact output of the page fixture used in the test suite, printed by the same function the command calls.
Candidate 1
content selector : div.entry-content
strip inside it : div.sharedaddy
div, 2081 characters, 3 paragraphs, 1 link, score 4519.8
starts with : The harbour wall was rebuilt over the winter and reopened in March. Fishermen say the new slipway is easier to use at low tide. The works cost less than the fir
Check the first candidate against a second article of the same site before trusting it: one page cannot tell a stable selector from a lucky one.
content selector is the block to keep. strip inside it lists blocks that sit inside that block and look like page furniture, so you can drop them.
Why the selector is short
A browser inspector hands you the full path of the node you clicked, which matches that one page and breaks on the next one. selectorprobe only ever writes selectors made of ids, tag.class steps, and descendant chains of those, and it refuses any name that looks generated: a hash, a framework prefix, or a name carrying a record number such as post-4821. It also walks down from the block it picked while a single child still holds nearly all of the text, so the title bar, the tag list and the comment area stay out of the selector.
It never prints a selector it has not counted: a candidate is only offered once the tool has checked that it matches exactly one node of the page.
Options
--filereads the argument as a local HTML file instead of downloading it.--top Nprints up to N candidates, best first, default 3.--jsonprints the result as JSON instead of text.--timeout Ssets the network timeout in seconds, default 20.--user-agent Ssets the User-Agent sent with the request.
Exit code 0 when at least one candidate was found, 1 when the page yields none, 2 when the page could not be read.
What it does not do
It does not run JavaScript. A page that ships an empty document and fills it from a script yields no candidate, and the tool says so rather than guessing.
It downloads the one URL you give it, following redirects the way the standard library does by default, and touches the network nowhere else. It stores no cookie, writes nothing to disk, sends no telemetry, and reads at most 8 MB of a page.
It does not talk to your feed reader. It prints selectors and you paste them.
Requirements
Python 3.9 or newer. No dependency, standard library only.
Honest limits
This has been run on HTML fixtures written for its own test suite, and never against a live website. The scoring was tuned on those fixtures. If it picks the wrong block on a real page, that is a defect worth an issue, and the page URL is the only thing needed to reproduce it.
The tool reads the markup a server sends. Sites that assemble their article in the browser are outside what it can see, and so are pages behind a login or a challenge.
A score is a comparison between blocks of the same page and nothing more. It does not compare across sites and it does not measure quality.
Where this came from
The demand thread is FreshRSS/FreshRSS#9340, where someone asked whether a tool exists that generates these values instead of copying them out of an inspector by hand. selectorprobe is not affiliated with that project and is not an extension for it: it is a standalone command that prints selectors, usable with any reader that takes a CSS selector for full text extraction.
Licence
MIT, Younes Z.
Built with AI assistance, reviewed and tested by me.
Metadata
Release files for selectorprobe 0.1.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 |
|---|---|---|---|---|
| selectorprobe-0.1.0.tar.gz | 16.7 kB | Without provenance | Details for selectorprobe-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| selectorprobe-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for selectorprobe-0.1.0-py3-none-any.whl |
Total release size: 29.4 kB
Release files / selectorprobe-0.1.0.tar.gz
| Download URL | selectorprobe-0.1.0.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c3ec1f9522ddaca1b3cd2531092e956687dba9ab88e0a3025f6806dd2fc37a44
|
|
BLAKE2b-256 checksum How to use checksums |
449b7a5941884aaebf3d25c140a2f3b59e340e9a3183e0e29dda9809c88e927e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / selectorprobe-0.1.0-py3-none-any.whl
| Download URL | selectorprobe-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
95a12fdc8c7c4d4de8b9a4579b0e0e76355c5da913d5ba01d33a26bd84f157c5
|
|
BLAKE2b-256 checksum How to use checksums |
48cfcf6d2981e2dfafd7ec0ec097adbe546e266a20be2cdc6f2363b76e969ed7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for selectorprobe 0.1.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.