Professional Python client for the AskPablos proxy API service
Project description
AskPablos API Client
A Python client for making GET requests through the AskPablos proxy service with browser automation support.
Documentation: https://askpablos-api.readthedocs.io/
Features
- Secure Authentication — HMAC-SHA256 signature-based
- Browser Automation — JavaScript rendering with
browser=True - Browser Operations — Wait for elements with
waitForElementbefore capturing HTML - Screenshot Capture —
screenshot=True - Error Handling — Specific exception types for each failure mode
Installation
pip install askpablos-api
# With lxml for HTML/XPath parsing
pip install "askpablos-api[parsing]"
Quick Start
from askpablos_api import AskPablos
client = AskPablos(
api_key="your_api_key",
secret_key="your_secret_key"
)
# Simple request
response = client.get("https://httpbin.org/ip")
print(response.content)
Browser Mode & HTML Parsing
For JavaScript-rendered pages, use browser=True with operations to wait for
content before capturing. Use lxml to parse the HTML.
from lxml import etree
response = client.get(
url="https://example.com/catalog",
browser=True,
operations=[{
"task": "waitForElement",
"match": {
"on": "xpath",
"rule": "visible",
"value": "//ul[@class='prod_list']"
}
}],
timeout=45
)
dom = etree.HTML(response.content)
for li in dom.xpath("//ul[@class='prod_list']/li"):
name = li.xpath(".//span[@class='pr_title']/text()")
print(name[0].strip() if name else "")
Screenshot
response = client.get(
url="https://example.com",
browser=True,
screenshot=True
)
if response.screenshot:
with open("screenshot.png", "wb") as f:
f.write(response.screenshot)
Error Handling
from askpablos_api import (
AuthenticationError,
APIConnectionError,
RequestTimeoutError,
ResponseError
)
try:
response = client.get("https://example.com", timeout=30)
except AuthenticationError as e:
print(f"Auth failed: {e}")
except APIConnectionError as e:
print(f"Connection error: {e}")
except RequestTimeoutError as e:
print(f"Timed out: {e}")
except ResponseError as e:
print(f"HTTP error: {e}")
Development
git clone https://github.com/fawadss1/askpablos_api.git
cd askpablos-api
pip install -e ".[dev]"
License
MIT — see LICENSE for details.
Support
- Email: fawadstar6@gmail.com
- Issues: GitHub Issues
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file askpablos_api-0.3.1.tar.gz.
File metadata
- Download URL: askpablos_api-0.3.1.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
461901c254045efa3e481cbb4cf0155586fcbda1c25075c1597a4e64c230ba87
|
|
| MD5 |
c23a38aeee8a939fdbfcf5d1a2b1ce81
|
|
| BLAKE2b-256 |
7e4ce745f59a03897d387547a18757ac68d810f2eba55898b814d5f90d213328
|
File details
Details for the file askpablos_api-0.3.1-py3-none-any.whl.
File metadata
- Download URL: askpablos_api-0.3.1-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69a6ad425bed71fc56b047bb948a2596433c536f3e529f8fa77e69dd810ba6b8
|
|
| MD5 |
6d68cf2d7bbe9d5506028841003402c4
|
|
| BLAKE2b-256 |
b4ea852fc839c1f7b4a0f4a41c1ff2a95b48e86600fe2ae27f071a82feba590e
|