Skip to content

Commit

Permalink
Fix SSL CERTIFICATE_VERIFY_FAILED
Browse files Browse the repository at this point in the history
  • Loading branch information
slow-mo committed Jan 12, 2022
1 parent 77f9414 commit ba67ca3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scraper.py
Expand Up @@ -8,7 +8,14 @@
# expose a way to alter this. So we'll fiddle our environment ourselves
# before our pipeline modules load.
os.environ['SCRAPERWIKI_DATABASE_NAME'] = 'sqlite:///data.sqlite'


# fix SSL CERTIFICATE_VERIFY_FAILED
import ssl
if (not os.environ.get('PYTHONHTTPSVERIFY', '') and getattr(ssl, '_create_unverified_context', None)):
ssl._create_default_https_context = ssl._create_unverified_context



USER_AGENT = 'Mozilla/5.0 (X11; Linux i686; rv:64.0) Gecko/20100101 Firefox/64.0'

def parse_lettera(url):
Expand Down

0 comments on commit ba67ca3

Please sign in to comment.