What's the fastest way to get HTTP on Python?
After getting, I try to find a string like content = url.get("http://example.com/foo/bar")
but I don't know how to get it.
I heard that I can use httplib or urilib, but maybe because I can't speak English, I don't know.
I have to open it. I'm looking for something. I can't open it.
If you know how to use it, please let me know
I'm using Python 2
python http network
import urllib2
urllib2.urlopen("http://example.com/foo/bar").read()
import urllib.request
urllib.request.urlopen("http://example.com/foo/bar").read()
import requests
r = requests.get("http://www.naver.com")
print(r.status_code)
print(r.headers)
print(r.content)
© 2024 OneMinuteCode. All rights reserved.