Minimal browser for performing web-based actions on your command.
Project description
Web-use
webuse is a http request library and a minimal headless browser, wrapped with the AI
buzzword -- the "Agent".
It can perform web-based actions on your command with natural languages, on par with
other "agent" libraries like browser-use or computer-use, but at a smaller
footprint.
As a project from the author of curl-cffi, webuse was built with impersonating human
behavior at the very beginning. So unlike other academic focused projects, webuse
tends to have lower rate of being detected as bot by WAFs like Cloudflare. In real
world, everyone have the same LLMs, such as ChatGPT, Claude and DeepSeek, so the
ability to mimic human behavior becomes the key differentiator for success rate.
This is a opinionated library, we only support certain preferred tools at core. However, feel free to contribute and maintain your flavor.
Features(to be implemented)
- Execute JavaScript directly, like
pyexecjs, but via API.- Pass a piece of script and execute directly.
- Register a script to be called later via name or id.
- Create virtual env with custom patches.
- Use JS RPC to call the algorithm on host page.
- Execute functions directly within the page context.
- Register additional scripts to the page.
- Docker image for one-click install as a service.
- Call webuse as a headless browser, without the
webdriverattributes.- Integrate common anti-detect scripts from Undetected chromedriver
- Generate random values for JS based fingerprints.
Usage
pip install webuse
On Linux servers, it's best to run this with xvfbwrapper
The main interface is a simple webbrowser-like UI for debuggin purposes. Once started, A HTTP API will be exposed for you to interact with cute agent.
When a render request is submitted, a tab will be selected to render the page, once finished, the content will be cached to a pool, waiting for retrieval, and the tab will be recycled.
The cache will be removed after a given time or once it is retrieved.
Headless browser
You do not need to create a patched environment to emulate the browser, because it's indeed a real WebKit based browser. On the other hand, it's built for crawling, not testing. It's much easier to manage a wkenv service than a Playwright or Selenium service.
TODO
- Make the UI better, more browser-like
- Add mulitple webview for parallelized rendering
- Add lock when a webview is occupied for rendering
- When all tabs are being used, return a busy error
- Add a pool for caching rendered content
- Add a busy wait endpoint for retrieving the content
Acknowledgements
PySide6 tutorial: https://www.pythonguis.com/pyqt6/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file webuse-0.0.1.tar.gz.
File metadata
- Download URL: webuse-0.0.1.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5698647e8c6ab0f45334b11e4e3fc6c6490eedf32346afa3731e501df6fc2225
|
|
| MD5 |
870942bce4f9217a25e0d3967d6f84ce
|
|
| BLAKE2b-256 |
7ba90471b9413343629eea0958fba85f879096dcd2a4120de53594d006e769fd
|