I am trying to extract HTML data from the webpage shown in the code below. Other websites work, but the one shown in the code below causes an error. What is causing the error?
This is the code
import requests
url = 'https://clasificadosonline.com/' # URL of the webpage to scrape
try:
response = requests.get(url)
response.raise_for_status()
html_content = response.text
# Print the HTML content
print(html_content)
except requests.exceptions.RequestException as e:
print(f"Request failed: {e}")
except requests.exceptions.RequestException as e:
print(f"Request failed: {e}")
This is the error I am getting.
"C:Users17874OneDrive - University of Puerto RicoDesktopWebScrapingvenvScriptspython.exe" "C:Users17874OneDrive - University of Puerto RicoDesktopWebScrapingvenvClasificados Online.py"
Request failed: HTTPSConnectionPool(host='clasificadosonline.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:997)')))
Process finished with exit code 0
'''
New contributor
Josue Laborde is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.