Oct-25-2020, 04:56 PM
I'd like just to add that this program works without any exception:
import urllib.request sp_link = r'https://www.kernel.org/doc/readme/drivers-staging-lustre-README.txt' count = 0 try: with urllib.request.urlopen(sp_link) as ip_file: for line in ip_file: count += 1 print(count) except urllib.error.HTTPError as e: print(e.reason)I cannot understand what is the problem. It must be something in the URL address.