Skip to main content

WebQuest is an extensible Python toolkit for high-level web scraping, built around a generic Playwright-based scraper interface for quickly building, running, and reusing custom scrapers.

Project description

WebQuest

WebQuest is an extensible Python toolkit for high-level web scraping, built around a generic Playwright-based scraper interface for quickly building, running, and reusing custom scrapers.

Scrapers

  • Any Article: Extracts readable content from arbitrary web articles.
  • DuckDuckGo Search: General web search using DuckDuckGo.
  • Google News Search: News-focused search via Google News.
  • YouTube Search: Search YouTube videos, channels, posts, and shorts.
  • YouTube Transcript: Fetch transcripts for YouTube videos.

Runners

  • Hyperbrowser: Executes scraping tasks using Hyperbrowser.

Installation

Installing using pip:

pip install webquest

Installing using uv:

uv add webquest

Usage

Example usage of the DuckDuckGo Search scraper:

import asyncio

from webquest.runners import Hyperbrowser
from webquest.scrapers import DuckDuckGoSearch


async def main() -> None:
    runner = Hyperbrowser()
    scraper = DuckDuckGoSearch()

    response = await runner.run(
        scraper,
        scraper.Request(query="Pizza Toppings"),
    )
    print(response.model_dump_json(indent=4))


if __name__ == "__main__":
    asyncio.run(main())

You can also run multiple requests at the same time:

import asyncio

from webquest.runners import Hyperbrowser
from webquest.scrapers import DuckDuckGoSearch


async def main() -> None:
    runner = Hyperbrowser()
    scraper = DuckDuckGoSearch()

    responses = await runner.run_multiple(
        scraper,
        [
            scraper.Request(query="Pizza Toppings"),
            scraper.Request(query="AI News"),
        ],
    )
    for response in responses:
        print(response.model_dump_json(indent=4))


if __name__ == "__main__":
    asyncio.run(main())

To use the Hyperbrowser runner, you need to set the HYPERBROWSER_API_KEY environment variable.

To use the Any Article scraper, you need to set the OPENAI_API_KEY environment variable.

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

webquest-0.5.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

webquest-0.5.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file webquest-0.5.0.tar.gz.

File metadata

  • Download URL: webquest-0.5.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.1

File hashes

Hashes for webquest-0.5.0.tar.gz
Algorithm Hash digest
SHA256 b6e7478364fe63e878a994c28f9bc9467c9605585a1099620ab9724cf140c8d1
MD5 aca1bd00a7b0b84b3aee8ddb4f48327e
BLAKE2b-256 4bf5435024a581753f12d2e53dcc98650c55bf2aa3041c09ce83156e6d458d4d

See more details on using hashes here.

File details

Details for the file webquest-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: webquest-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.1

File hashes

Hashes for webquest-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b95aa29d4c7587ed7f20c61096b7d53f8902a90271f50b21fd7a256b5bb990cb
MD5 2db98a581b4d12d7b99b2effab44b118
BLAKE2b-256 e6f0cc1db4204bdb1dea8557671b5885b91aec5b8e7aefe1dc8a860104fc2caa

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