An empty HTML table does not always mean the response contains no proxy records. Some listings put JSON objects inside JavaScript calls and populate the rows later.

For an already obtained source using the specific wrapper gp.insertPrx followed by a JSON object:

import ipaddress
import json
import re

decoder = json.JSONDecoder()
endpoints = set()
for marker in re.finditer(r"gp[.]insertPrx\(\s*", html):
    try:
        row, end = decoder.raw_decode(html, marker.end())
        if not isinstance(row, dict):
            continue
        address = ipaddress.ip_address(row["PROXY_IP"])
        port = int(row["PROXY_PORT"], 16)
    except (ValueError, KeyError, TypeError):
        continue
    if 1 <= port <= 65535 and html[end:].lstrip().startswith(");"):
        endpoints.add((str(address), port))

html is the source text, not a browser object. The regular expression finds a known wrapper; JSONDecoder determines where its JSON value ends. This avoids trying to parse nested JSON with a regular expression alone.

The example’s port field is explicitly hexadecimal: C38 means decimal 3128. Do not apply base 16 to an unrelated provider’s decimal field just because both are named port.

This is a parser for the stated format, not a JavaScript interpreter. Single-quoted object literals, computed values and other JavaScript expressions need another documented data interface. Do not evaluate arbitrary page code to obtain an endpoint list.

Validate the source contract and retain protocol fields separately. For a source with populated HTML rows instead, use row-scoped endpoint extraction rather than this JavaScript-wrapper parser. Extracting an address and port does not establish that the endpoint currently offers a usable proxy service.

Erthyglow kevrennek