[Python] Importing geographic data with WFS works on Chrome but not on Python

Discussão em 'Python' iniciado por Stack, Abril 21, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to pull a geojson file from here.

    The JSON appears as expected when I paste that link into Chrome or Safari. However, I get the following error every time when I run the following code on Python:

    import requests
    import pathlib

    url = "https://geoserver.car.gov.br/geoserver/sicar/ows?service=WFS&version=2.0.0&request=GetFeature&count=10&startIndex=10000&typeName=sicar%3Asicar_imoveis_ac&outputFormat=application%2Fjson"

    r = requests.get(url, timeout=120, verify=False)


    This is the error:

    SSLError: HTTPSConnectionPool(host='geoserver.car.gov.br', port=443): Max retries exceeded with url: /geoserver/sicar/ows?service=WFS&version=2.0.0&request=GetFeature&count=10&startIndex=10000&typeName=sicar%3Asicar_imoveis_ac&outputFormat=application%2Fjson (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] ssl/tls alert handshake failure (_ssl.c:1006)')))

    Continue reading...

Compartilhe esta Página