LeninGangwal / Big-Basket-Delivery-Slots

Automates the process of finding delivery slots in BigBasket during the Covid-19 chaos.
41 stars 16 forks source link

Getting error on SSL #10

Open Code25356 opened 4 years ago

Code25356 commented 4 years ago

Hi, Keep getting following error whenever running on Mac

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1319, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1230, in request self._send_request(method, url, body, headers, encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1276, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1225, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1004, in _send_output self.send(msg) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 944, in send self.connect() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1399, in connect self.sock = self._context.wrap_socket(self.sock, File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1040, in _create self.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "BB_slot.py", line 52, in main() File "BB_slot.py", line 49, in main get_bb_slot('https://www.bigbasket.com/basket/?ver=1') File "BB_slot.py", line 10, in get_bb_slot chromedriver_autoinstaller.install() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/chromedriver_autoinstaller/init.py", line 15, in install chromedriver_filepath = utils.download_chromedriver(cwd) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/chromedriver_autoinstaller/utils.py", line 165, in download_chromedriver chromedriver_version = get_matched_chromedriver_version(chrome_version) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/chromedriver_autoinstaller/utils.py", line 131, in get_matched_chromedriver_version doc = urllib.request.urlopen('https://chromedriver.storage.googleapis.com').read() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 222, in urlopen return opener.open(url, data, timeout) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 525, in open response = self._open(req, data) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 542, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 502, in _call_chain result = func(*args) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1362, in https_open return self.do_open(http.client.HTTPSConnection, req, File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1322, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)>

i-love-to-code commented 4 years ago

Google is your friend! https://stackoverflow.com/questions/44649449/brew-installation-of-python-3-6-1-ssl-certificate-verify-failed-certificate/44649450#44649450

This appears to be an issue with the default Python install. I'm not a Python developer at all, but used this process to get things working:

  1. Download the latest version of Python and install it https://www.python.org/downloads/
  2. Run the installer and when it completes, you need to run /Applications/Python 3.8/Install Certificates.command to install
  3. Follow the instructions in the readme

Script is now happily running. Fingers crossed for a slot!