Hi all,
How do I use urllib.request module in Python 3.7 to open a pdb file?
The URL I’m using is http://files.rcsb.org/download/1N5O.pdb.
I’ve read about the need for SSL support but I’m not too sure how to write a code which incorporates those principles.
Here is how my code looks like thus far:
import urllib.request req= urllib.request.Request("http://files.rcsb.org/download/1N5O.pdb")
with urllib.request.urlopen(req) as response:
the_page= response.read()
print (the_page)
Any advice on the above would be much appreciated. Thank you!
(For more accurate formatting, I've attached my picture here in [1]:
Hi Alex,
Thank you very much for your help.
I have applied these to my code, and its working fine now.
Have a good week ahead.