Wondering what I'm missing... urllib3 request isnt returning...
import urllib3
url = "https://www.mouser.com/images/adi/sm/ITP_ADI_SOT-23-6_05-08-1636_t.jpg"
http = urllib3.PoolManager()
response = http.request('GET', url)
print(response.status)
Stepped through it in debug and this is what I see:
CodePudding user response:
you need to specify the headers.
import urllib3
url = "https://www.mouser.com/images/adi/sm/ITP_ADI_SOT-23-6_05-08-1636_t.jpg"
http = urllib3.PoolManager(headers={'User-Agent': 'Mozilla/5.0'})
response = http.request('GET', url)
print(response.status)