Skip to main content

A simple, human-friendly web scraper wrapper using httpx, BeautifulSoup, and Playwright.

Project description

Scraper

A simple and practical Python web scraper for real‑world websites. It supports normal HTTP scraping, JavaScript rendering via Playwright, rate limiting, pagination, form submission, file downloads, and structured data extraction.

Designed to be usable, reliable, and flexible.


Features

  • HTTP scraping with httpx
  • Automatic fallback to browser mode (Playwright) when blocked
  • JavaScript rendering support
  • Rate limiting
  • Parallel fetching
  • Table extraction with rowspan / colspan
  • Pagination (patterned pages + "Next" button)
  • JSON endpoints
  • Form submission
  • Image and file downloading
  • CSV / JSON export
  • Logging system

Install

pip install httpx beautifulsoup4 playwright
playwright install chromium

Basic Usage

from scraper import Scraper

s = Scraper(url="https://example.com", debug=True)
s.fetch()

print(s.get_text("h1"))
print(s.get_links())

Common Examples

Fetch a page

s.fetch("https://example.com")

Force JS rendering

s.fetch("https://site.com", use_browser=True)
# or
s.render_js()

Extract text

s.get_text(".title")
s.get_text_clean(".content")

Get links & images

s.get_links()
s.get_images()

Extract tables

table = s.get_table()

Scrape paginated pages

s.scrape_pages("https://site.com/page/{}", 5, ".item")

Auto "Next" pagination

s.scrape_auto_next("https://site.com", ".post")

Parallel fetch

urls = ["https://a.com", "https://b.com"]
s.fetch_multiple(urls, workers=5)

JSON API

s.get_json("https://api.site.com/data")

Submit form

s.submit_form("https://site.com/login", {
    "user": "name",
    "pass": "password"
})

Download files

s.download_file(url, "file.pdf")
s.download_images("images/")

Export

s.export_csv(data, "data.csv")
s.export_json(data, "data.json")

Close resources

s.close()

Notes

  • Automatically switches to browser mode if blocked
  • Thread‑safe request handling
  • Suitable for large scraping jobs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ezextract-0.1.2.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ezextract-0.1.2-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file ezextract-0.1.2.tar.gz.

File metadata

  • Download URL: ezextract-0.1.2.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for ezextract-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5691ae52ab1d509e772716002392628f75561f7d528ad90996601eda8ebd33e1
MD5 3b27997209c870719d1349d4f9065a09
BLAKE2b-256 bdef5c0b667a18c647b70e78d1181a8393b1da7d8de63dbcb7d1b1997e3a5685

See more details on using hashes here.

File details

Details for the file ezextract-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ezextract-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for ezextract-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5ff133ee7bad61bd470d27a0554558191b08c6bc66dfa5e81ba15311aa2329a7
MD5 983763155fffea5e52e50f63a82740c9
BLAKE2b-256 bab7bc77b01886c19f1dde24e9a7802d36e4ee8ce0c2b4bd3899524a3f574875

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page