Can you run
note the changes I have made and which you should keep.
Also parsing html with regex is big NO. HTML should not be used with regex read You can't parse [X]HTML with regex
import urllib.request, re with open("test.txt", "r") as url_file: for line in url_file: line = line.strip() print(line) text = urllib.request.urlopen(line).read().decode('utf-8')this way we shall see which url creates a problem, i.e. do you get to the end of the list. But it looks like you have empty lines at the end of the urls file...
note the changes I have made and which you should keep.
Also parsing html with regex is big NO. HTML should not be used with regex read You can't parse [X]HTML with regex
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs