Skip to main content

Quokka - Browser Automation Library with Playwright

Quokka is a powerful Python library built on top of Playwright, designed to simplify browser automation and manipulation tasks. It provides a convenient facade for various browser interactions, making it easier to navigate web pages, extract data, and interact with page elements.

Key Features

  • Asynchronous and Parallel Execution: Quokka operates entirely in an asynchronous manner. Leveraging the power of Playwright, it utilizes multiple processes, each containing a single coroutine, for efficient parallel execution. This architecture excels in handling both IO and CPU-bound workloads when ample resources are available.
  • Multi-threaded Crawling with Ease: Quokka's BaseCrawler class enables users to effortlessly transition from single-threaded to multi-threaded crawling. By taking advantage of the provided crawler template, you can seamlessly convert a single-threaded crawler into a multi-threaded one.
  • Easy Browser Management: Quokka's Agent class provides a streamlined interface for managing browser instances, including starting, stopping, and page navigation.
  • Data Extraction: With the data_extractor module, Quokka allows you to easily extract data from web pages using customizable selectors and extraction patterns.
  • Page Interaction: The page_interactor module enables you to interact with web page elements, such as clicking, typing, and scrolling, making automation tasks a breeze.
  • Custom Hooks: Quokka supports customizable hooks, allowing you to extend and customize the behavior of the Agent class to fit your specific needs.
  • Extensible: Quokka exposes Playwright's playwright and page instances, enabling users to extend the library's functionality as required.

Installation

pip install quokka-web

Getting Started

Quokka's intuitive API makes browser automation a straightforward process. Here's a simple example:

from quokka_web import Agent


async def main():
    agent = await Agent.instantiate(headless=True)
    await agent.start()

    # Your automation code here

    await agent.stop()


if __name__ == "__main__":
    import asyncio

    asyncio.run(main())

Documentation

For detailed usage instructions, examples, and customization options, please refer to the Documentation.

Examples

Base Crawler Example:

from quokka_web import BaseCrawler, Debugger


class MyCrawler(BaseCrawler):
    async def _crawl(self, *args, **kwargs):
# Core crawling logic using browser_agent


if __name__ == "__main__":
    import asyncio


    async def main():
        crawler = await MyCrawler.instantiate(debug_tool=Debugger(verbose=True))
        await crawler.start()
        await crawler.crawl()
        await crawler.stop()


    asyncio.run(main())

Contributing

Contributions to Quokka are welcome! Please read our Contribution Guidelines for more information on how to contribute to the project.

License

This project is licensed under the MIT License.

Metadata

Release files for quokka-web 0.0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quokka-web 0.0.2.0
File Size Uploaded Provenance Actions
quokka-web-0.0.2.0.tar.gz 17.3 kB Without provenance Details for quokka-web-0.0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for quokka-web 0.0.2.0
File Interpreter ABI Platform Actions
quokka_web-0.0.2.0-py3-none-any.whl Python 3 none any Details for quokka_web-0.0.2.0-py3-none-any.whl

Total release size: 40.3 kB

Release files / quokka-web-0.0.2.0.tar.gz

Download URL quokka-web-0.0.2.0.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f00a52ef95fd0d84fc721d04d559d8e75b85cff93b6b1fab32d211187645214b
BLAKE2b-256 checksum
How to use checksums
4a7d9f851284d48e62f567a8d516865f82ec8c00b2208048db04bf5a47a48672
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.8

Release files / quokka_web-0.0.2.0-py3-none-any.whl

Download URL quokka_web-0.0.2.0-py3-none-any.whl
Size 22.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b2c84c4daecdf37282ae0eb2c3700f6c2eec3252a97efd0e53299b27c88c9eb
BLAKE2b-256 checksum
How to use checksums
38a39ad7952b2f7e1a26d8d5ea2894c2bdc4d4c84569b2ff115249055c015f19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.8

Security for quokka-web 0.0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page