Skip to main content

Professional Python client for the AskPablos proxy API service

Project description

AskPablos API Client

PyPI Version PyPI Downloads Supported Python Versions License: MIT GitHub Issues

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 waitForElement before capturing HTML
  • Screenshot Capturescreenshot=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

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

askpablos_api-0.3.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

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

askpablos_api-0.3.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file askpablos_api-0.3.0.tar.gz.

File metadata

  • Download URL: askpablos_api-0.3.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for askpablos_api-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f54d376f00db2d0872a2224ed9acd5e629fe88e0ad66a5086740addf3d2fbdf2
MD5 e985f3fdea464327b5490d2484441105
BLAKE2b-256 ab3799c9d6e4535c3e929f9140897855d746b351fb48649b6a4598f168bb7ee4

See more details on using hashes here.

File details

Details for the file askpablos_api-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: askpablos_api-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for askpablos_api-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2fe691aa1834d75f2b665b4dd71d020d2ca79a846b70531163bd0dcdc2165ed
MD5 7e53cca417d6232ee7b6d5fa59d34176
BLAKE2b-256 eb74d05d4cd9b4c9fcde3fa98c2548775c11b52836149068426022dc66b46331

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