Advertisement
metalx1000

Retrieve html from encrypted site https ssl

Dec 25th, 2015
613
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import urllib3
  4. import certifi
  5.  
  6. http = urllib3.PoolManager(
  7.   cert_reqs='CERT_REQUIRED', # Force certificate check.
  8.   ca_certs=certifi.where(),  # Path to the Certifi bundle.
  9. )
  10.  
  11. # You're ready to make verified HTTPS requests.
  12. try:
  13.   print "Connecting..."
  14.   r = http.request('GET', 'https://iaff2396.com/')
  15.   html = r.read()
  16.   print html
  17. except urllib3.exceptions.SSLError as e:
  18.   print "error"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement