c# .net Adsense ADO.NET Linq Viruses/security asp.net MVC JQuery Angular-js Node-js SEO Java C++ SQL API Networking vb.net .Net Css JavaScript Generics c#.Net entity framework HTML Website host Website Construction Guide HTTP tutorial W3C tutorial Web Services JSON Psychology Ionic framework Angular ReactJS Python Computer Android
Python

AttributeError: module 'urllib' has no attribute 'urlopen' - Python

| | python

I m using the python program to bypass ssl certificate verification. I want to make an https request using the urllib library.

import ssl

import urllib

context = ssl._create_unverified_context()
res= urllib.urlopen("https://infinetsoft.com", context=context)
print(res)

I got this following error while running the python program

"AttributeError: module 'urllib' has no attribute 'urlopen'"

To resolve this problem, change the code to

import ssl

import urllib.request as urlrq

context = ssl._create_unverified_context()
res= urlrq.urlopen("https://infinetsoft.com", context=context)
print(res)

VIDEO GUIDE: