Metadata-Version: 2.4
Name: extrahtml
Version: 0.1.2
Summary: Fetch HTML from a URL using requests, Selenium, or Playwright.
Home-page: https://github.com/optima1236/extrahtml
Author: optima1236
Author-email: rin98182@gmail.com
License: MIT
Project-URL: Homepage, https://github.com/optima1236/extrahtml
Project-URL: Repository, https://github.com/optima1236/extrahtml
Project-URL: Bug Tracker, https://github.com/optima1236/extrahtml/issues
Keywords: html scraping requests selenium playwright parseyaml
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/plain
License-File: LICENSE
Requires-Dist: requests>=2.28.0
Requires-Dist: parseyaml>=1.2.0
Requires-Dist: fake-useragent>=1.4.0
Provides-Extra: selenium
Requires-Dist: selenium>=4.0.0; extra == "selenium"
Requires-Dist: undetected-chromedriver>=3.5.0; extra == "selenium"
Provides-Extra: playwright
Requires-Dist: playwright>=1.40.0; extra == "playwright"
Requires-Dist: playwright-stealth>=1.0.0; extra == "playwright"
Provides-Extra: cloudscraper
Requires-Dist: cloudscraper>=1.2.0; extra == "cloudscraper"
Provides-Extra: all
Requires-Dist: selenium>=4.0.0; extra == "all"
Requires-Dist: undetected-chromedriver>=3.5.0; extra == "all"
Requires-Dist: playwright>=1.40.0; extra == "all"
Requires-Dist: playwright-stealth>=1.0.0; extra == "all"
Requires-Dist: cloudscraper>=1.2.0; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

extrahtml
=========

extrahtml is a small Python library that fetches HTML from a URL using
different engines: requests, Selenium, or Playwright. You can choose the
engine that fits your needs and optionally enable a bypass mode for
maximum stealth when dealing with bot-protected sites.

INSTALLATION
------------

Install the core package:

    pip install extrahtml

Install optional dependencies for specific engines:

    pip install extrahtml[selenium]      # Selenium engine
    pip install extrahtml[playwright]    # Playwright engine
    pip install extrahtml[cloudscraper]  # Cloudscraper bypass for requests
    pip install extrahtml[all]           # Everything

For Playwright, you also need to install the browser binaries:

    playwright install chromium

USAGE
-----

Requests engine (fast, no JavaScript):

    from extrahtml import RequestsEngine

    engine = RequestsEngine(bypass=True)
    html = engine.get("https://example.com")
    print(html)

Selenium engine (JavaScript rendering, optional stealth):

    from extrahtml import SeleniumEngine

    engine = SeleniumEngine(bypass=True, headless=True)
    html = engine.get("https://example.com")
    print(html)

Playwright engine (JavaScript rendering, optional stealth):

    from extrahtml import PlaywrightEngine

    engine = PlaywrightEngine(bypass=True, headless=True, browser_type="chromium")
    html = engine.get("https://example.com")
    print(html)

BYPASS MODE
-----------

When bypass=True is passed to an engine, the library tries to enable all
available stealth measures:

- RequestsEngine: uses Cloudscraper (if installed), random User-Agents
  from fake-useragent, and random delays between requests.
- SeleniumEngine: uses undetected-chromedriver (if installed) and
  additional Chrome flags to hide automation markers.
- PlaywrightEngine: applies playwright-stealth patches (Chromium only)
  and launches the browser with a realistic viewport and User-Agent.

Note that bypass mode does not guarantee success against every anti-bot
system. For serious scraping tasks, combine it with proxies, realistic
timing, and possibly a headful browser.

LICENSE
-------

MIT License. See the LICENSE file for details.
