For web scraping practice I got a sample code and tried scraping I was addicted to the exception, so make a note of the event and the solution.
[Python] Get stock price data by scraping When I executed the script, the error ↓↓ occurred and the process could not proceed. The PC was just after returning to the factory default, so I'm quite impatient.
Script execution result error message
requests.exceptions.SSLError: HTTPSConnectionPool(host='***.co.jp',
port=443): Max retries exceeded with url: / (Caused by SSLError("Can't
connect to HTTPS URL because the SSL module is not available."))
anaconda 1.9.12 python 3.8.3
Reference: https://stackoverflow.com/questions/54135206/requests-caused-by-sslerrorcant-connect-to-https-url-because-the-ssl-module
I fixed it by putting the following path in the environment variable.
Environment variable
%USERPROFILE%\Anaconda3
%USERPROFILE%\Anaconda3\scripts
%USERPROFILE%\Anaconda3\Library\bin
Specifically, it looks like this.
Looking back now, even though the python execution environment is anaconda3, I started python from vscode. I wondered if the package installed by anaconda was not referenced. Anyway, I'm glad I solved the problem.
Recommended Posts