PacktPublishing / Mastering-Geospatial-Analysis-with-Python

Mastering Geospatial Analysis with Python, published by Packt
MIT License
83 stars 48 forks source link

SSL Handshake Error #2

Closed ksmiley92 closed 7 months ago

ksmiley92 commented 7 months ago

**Hello,

On page 48 (hard copy book) under the section "Adding Data to Table" I get the following error after running the requests.get method. I'm new to the web scraping thing and despite watching multiple vids and articles, cannot seem to figure it out. My db works fine and the art_pieces table was created. The City of Albuquerque GIS rest server is also working in a browser. I'm runnning the code in the windows command prompt **

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "C:\Users\Kyle\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\api.py", line 73, in get return request("get", url, params=params, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Kyle\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\api.py", line 59, in request return session.request(method=method, url=url, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Kyle\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\sessions.py", line 589, in request resp = self.send(prep, send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Kyle\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\sessions.py", line 703, in send r = adapter.send(request, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Kyle\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\adapters.py", line 517, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='coagisweb.cabq.gov', port=443): Max retries exceeded with url: /arcgis/rest/services/public/PublicArt/MapServer/0/query?where=1%3D1&outFields=%2A&outSR=4326&f=json (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1000)')))

ksmiley92 commented 7 months ago

I'm using Python 3.12

ksmiley92 commented 7 months ago

it appears to have been a bug in Python 3.12. I used the 3.6 virtual env in conda successfully