使用 Scrapling 获取网页内容,返回纯文本或选择器结果。
bash
pip install "scrapling[all]"
scrapling install
pip install httpx
bash
python scripts/scrape_web.py --url "https://example.com"
bash
python scripts/scrape_web.py --url "https://example.com" --selector "title::text"
bash
python scripts/scrape_web.py --url "https://example.com" --out "output.txt"