CLI for saving and running Goodinfo stock screener presets with Playwright browser automation.
Project description
goodinfo-screener-cli
goodinfo-screener-cli is a Python CLI for turning a Goodinfo stock screener URL
that you already use manually into a repeatable local workflow.
It saves named screener presets, opens them with a local Playwright browser, waits for the Goodinfo result table, parses the visible rows, prints a terminal preview, and can export the same data to CSV or JSON.
This project is intended for low-frequency personal research automation. It does not provide investment advice, trading recommendations, bulk crawling, login-only automation, or CAPTCHA bypassing.
What It Does
- Saves Goodinfo
StockList.aspscreener URLs as named local presets - Stores presets in
~/.config/goodinfo-screener-cli/presets.yml - Runs a saved preset through Chromium with Playwright
- Waits for the stock result table to become available
- Parses rendered table headers and stock rows
- Prints a compact Rich terminal table
- Exports parsed rows to UTF-8 BOM CSV or pretty JSON
- Supports visible browser debugging with
--headful - Supports rendered HTML capture with
--htmlfor parser troubleshooting
Status
v0.1.0 is the first MVP release. The current scope is intentionally narrow:
Save one Goodinfo screener URL, run it locally, parse the rendered table,
preview the result, and export it.
See CHANGELOG.md for the release notes and verification summary. See docs/project-health.md for public project metrics, maintenance activity, roadmap evidence, and the AI-assisted maintenance plan.
Installation
This project targets Python 3.11 or newer.
PyPI distribution is prepared through GitHub Actions Trusted Publishing and will become available after the first PyPI release:
python -m pip install goodinfo-screener-cli
Install from a local checkout:
git clone https://github.com/pm7913/goodinfo-screener-cli.git
cd goodinfo-screener-cli
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e ".[dev]"
Install Playwright's Chromium browser:
playwright install chromium
Verify the CLI:
goodinfo --help
goodinfo --version
Quick Start
Create the local preset store:
goodinfo init
Save a Goodinfo stock screener URL as a preset:
goodinfo import high-margin "https://goodinfo.tw/tw/StockList.asp?..."
Run the preset and print a readable preview:
goodinfo run high-margin --limit 10 --column-limit 8
Export the parsed rows:
goodinfo run high-margin \
--csv results/high-margin.csv \
--json results/high-margin.json
Debug page or parser changes with a visible browser and rendered HTML output:
goodinfo run high-margin --headful --html fixtures/high-margin.html
See examples/high-margin.yml for a sample preset based on a cumulative net profit margin screener.
Demo
The CLI keeps the workflow local and inspectable: save one screener URL, run it through a browser session you control, review a compact terminal table, and write CSV or JSON when you need to continue the analysis elsewhere.
Commands
goodinfo init
Creates the local preset directory and an empty preset file if needed.
Default location:
~/.config/goodinfo-screener-cli/
presets.yml
goodinfo import <name> <url>
Validates and saves a Goodinfo screener URL.
Rules:
<name>must be unique unless--forceis used- URL must use
https://goodinfo.tw/ - URL path must target
/tw/StockList.asp
Examples:
goodinfo import high-margin "https://goodinfo.tw/tw/StockList.asp?..."
goodinfo import high-margin "https://goodinfo.tw/tw/StockList.asp?..." --force
goodinfo list
Prints saved presets with their name, source, creation time, and URL.
goodinfo list
goodinfo run <name>
Loads a saved preset, opens it in Playwright, parses the rendered Goodinfo table, prints a terminal preview, and optionally writes export files.
Useful options:
goodinfo run high-margin
goodinfo run high-margin --headful
goodinfo run high-margin --timeout 45000
goodinfo run high-margin --limit 25 --column-limit 8
goodinfo run high-margin --csv results/high-margin.csv
goodinfo run high-margin --json results/high-margin.json
goodinfo run high-margin --html fixtures/high-margin.html
goodinfo remove <name>
Deletes a saved preset from the local preset file.
goodinfo remove high-margin
Preset Format
Presets are stored locally as YAML:
presets:
high-margin:
source: goodinfo
url: "https://goodinfo.tw/tw/StockList.asp?..."
created_at: "2026-06-01T00:00:00Z"
browser:
headless: true
timeout_ms: 30000
output:
format: table
The CLI currently creates and reads the preset metadata needed for the MVP workflow. Extra fields are reserved for future configuration.
Output
Terminal output uses Rich tables and is designed for quick inspection:
--limit <n>controls how many rows are printed--limit 0prints all rows--column-limit <n>controls how many columns are printed--column-limit 0prints all columns
Exports preserve the first-seen column order from parsed rows:
--csv <path>writes UTF-8 BOM CSV for spreadsheet compatibility--json <path>writes pretty UTF-8 JSON
Responsible Use
This tool is designed for transparent, user-controlled, low-frequency personal research automation.
Expected safeguards:
- Use a real local browser session
- Run one saved screener preset at a time
- Avoid high-frequency requests and bulk crawling
- Do not bypass CAPTCHAs, paywalls, account restrictions, or access controls
- Do not automate login-only workflows
- Do not redistribute proprietary datasets
- Verify market data before relying on it
- Respect Goodinfo's terms, privacy policy, and website availability
This project does not provide investment advice or trading recommendations. Users are responsible for ensuring their use complies with Goodinfo's terms and applicable laws.
Troubleshooting
Playwright Browser Is Not Installed
If goodinfo run fails because Chromium is missing, install it:
playwright install chromium
Goodinfo Page Loads But Parsing Fails
Goodinfo may change table markup over time. Re-run with rendered HTML output:
goodinfo run high-margin --html fixtures/high-margin.html
Then inspect whether the stock result table still uses #tblStockList or a
recognizable stock table structure.
Terminal Table Is Too Wide
Goodinfo tables can have many columns. Limit the preview:
goodinfo run high-margin --limit 10 --column-limit 8
Use --column-limit 0 only when your terminal is wide enough.
Browser Launch Fails On macOS
Headless browser launch can fail in restricted sandbox environments. Try running from a normal terminal session, or use:
goodinfo run high-margin --headful
Development
Install development dependencies with the editable install shown above, then run:
pytest
ruff check .
goodinfo --help
The implementation is split into small modules:
cli.pyowns command parsing and user-facing errorspresets.pymanages local YAML preset storage and validationbrowser.pywraps Playwright page loadingparser.pyextracts stock rows from rendered Goodinfo HTMLexporters.pyrenders terminal tables and writes CSV/JSON files
Tests avoid live Goodinfo requests by using synthetic fixtures and focused unit coverage. Browser smoke tests can be run manually when checking real site behavior.
See CONTRIBUTING.md for the pull request workflow and responsible-use contribution requirements.
Roadmap
Near-term follow-up work is tracked in GitHub issues:
- Support CLI-defined screener filters
- Improve parser resilience for Goodinfo layout changes
- Add optional local caching for recent runs
- Package and release distribution workflow
Out of scope for the MVP:
- Building every Goodinfo filter condition from CLI flags
- Running many presets in parallel
- Crawling individual stock detail pages
- Scheduled jobs
- Login-only workflows
- CAPTCHA handling or bypassing
- Hidden API reverse engineering as the default approach
- Investment strategy recommendations
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file goodinfo_screener_cli-0.1.0.tar.gz.
File metadata
- Download URL: goodinfo_screener_cli-0.1.0.tar.gz
- Upload date:
- Size: 21.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1365e0dc55549230fe7f2761f3e7093488249b9e2f1899ae210b9ee4a920452
|
|
| MD5 |
be80d630737a2f7b25ac071da2c76ee6
|
|
| BLAKE2b-256 |
6bafa9a8da62609318e580120e167ba678e83a426bcd2b80039f7d78b4269e26
|
Provenance
The following attestation bundles were made for goodinfo_screener_cli-0.1.0.tar.gz:
Publisher:
publish.yml on pm7913/goodinfo-screener-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
goodinfo_screener_cli-0.1.0.tar.gz -
Subject digest:
a1365e0dc55549230fe7f2761f3e7093488249b9e2f1899ae210b9ee4a920452 - Sigstore transparency entry: 1699286498
- Sigstore integration time:
-
Permalink:
pm7913/goodinfo-screener-cli@d7da543cd8f5ae1e43332955576516da3ac3c624 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pm7913
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d7da543cd8f5ae1e43332955576516da3ac3c624 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file goodinfo_screener_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: goodinfo_screener_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
312f3b90b8095579251cabf7f17b0ceac5fb0aa084a1a48451496b2b46ea5c0b
|
|
| MD5 |
36b31a30e81539d223a1fd9b4f9b35c3
|
|
| BLAKE2b-256 |
0ab929bb683dde95dfd4b08b9e98d768a808b200f8740ad03479d5076fb74f0f
|
Provenance
The following attestation bundles were made for goodinfo_screener_cli-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on pm7913/goodinfo-screener-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
goodinfo_screener_cli-0.1.0-py3-none-any.whl -
Subject digest:
312f3b90b8095579251cabf7f17b0ceac5fb0aa084a1a48451496b2b46ea5c0b - Sigstore transparency entry: 1699286607
- Sigstore integration time:
-
Permalink:
pm7913/goodinfo-screener-cli@d7da543cd8f5ae1e43332955576516da3ac3c624 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/pm7913
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d7da543cd8f5ae1e43332955576516da3ac3c624 -
Trigger Event:
workflow_dispatch
-
Statement type: