PyWebWrench Library 🔧
PyWebWrench is a Python library that enables you to view web pages and make HTTP requests using popular Python libraries such as Playwright and Requests.
Usage 🚀
Follow these steps to use the PyWebWrench library:
- Import the Library 📦
from PyWebWrench.py_web_wrench import PyWebWrench
- Create a PyWebWrench Object 👷
pr = PyWebWrench(browser_name="firefox") # You can choose a different browser.
- Render a Web Page 🌐
To view a web page, use the
render_pagefunction:
page_content = pr.render_page(url="https://www.example.com")
print(page_content)
- Control a Web Page 🎛️
To have more control over a web page, use the
control_pagefunction:
page = pr.control_page(url="https://www.example.com")
# Perform additional operations
page.close() # Don't forget to close the page when you're done.
- Make HTTP Requests 📞
PyWebWrench uses the Requests library to make HTTP requests. You can use the
get,post,put,delete,patch, andheadfunctions for this purpose.
Example of a GET request:
response = pr.get(url="https://api.example.com/data")
print(response.text)
Error Handling ⚠️
UnsupportedBrowserError: You might encounter this error for unsupported browsers.
Supported Browsers 🌐
- Chromium
- Chrome
- Chrome Beta
- Microsoft Edge
- Microsoft Edge Beta
- Microsoft Edge Dev
- Firefox
- Firefox ASAN
- Webkit
Dependencies 🖥️
Before using PyWebWrench, make sure to install the following dependencies:
- Playwright
- Requests
You can install these dependencies using the following commands:
pip install playwright
pip install requests
Conclusion 🎉
PyWebWrench is a handy Python library for viewing web pages and making HTTP requests. You can open, control, and send requests to web pages using the specified browsers. For more information about usage and functionality, you can explore the source code of PyWebWrench. 🔍
Feel free to contribute or report issues! 🙌
Metadata
Release files for PyWebWrench 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| PyWebWrench-0.0.7.tar.gz | 3.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| PyWebWrench-0.0.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.2 kB
Release files / PyWebWrench-0.0.7.tar.gz
| Download URL | PyWebWrench-0.0.7.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c8973da59a151d4a433cd1e5f1df84eeeb4f6ca7ffc59320f2e5e1d5d99cc3a2
|
|
BLAKE2b-256 checksum How to use checksums |
0a1756f5c1d487f11b58cdd64036d584b4799e3d30d258dd5dde34801d217c84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / PyWebWrench-0.0.7-py3-none-any.whl
| Download URL | PyWebWrench-0.0.7-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
52995b215f91b351838e106ab6c76cb1e6f8794a782729c50d4cca25d14560ff
|
|
BLAKE2b-256 checksum How to use checksums |
9154a0ed661d976d6acf73850fbf2bbdf2678bf3a392ab4cdaa032a0811beb81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|