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.1.tar.gz (15.7 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.1-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

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

Hashes for askpablos_api-0.3.1.tar.gz
Algorithm Hash digest
SHA256 461901c254045efa3e481cbb4cf0155586fcbda1c25075c1597a4e64c230ba87
MD5 c23a38aeee8a939fdbfcf5d1a2b1ce81
BLAKE2b-256 7e4ce745f59a03897d387547a18757ac68d810f2eba55898b814d5f90d213328

See more details on using hashes here.

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

Hashes for askpablos_api-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 69a6ad425bed71fc56b047bb948a2596433c536f3e529f8fa77e69dd810ba6b8
MD5 6d68cf2d7bbe9d5506028841003402c4
BLAKE2b-256 b4ea852fc839c1f7b4a0f4a41c1ff2a95b48e86600fe2ae27f071a82feba590e

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