import re, urllib.request
textfile = open('depth_1.txt','wt')
print('enter the url you would like to crawl')
print('Usage - "http://phocks.org/stumble/creepy/" <-- with the double quotes')
my_url = input()
for i in re.findall(b'''href=["'](.[^"']+)["']''', urllib.request.urlopen(my_url).read(), re.I):
print(i)
for ee in re.findall(b'''href=["'](.[^"']+)["']''', urllib.request.urlopen(i).read(), re.I): #this is line 20!
print(ee)
textfile.write(ee+'\n')
textfile.close()
After looking around for a solution to my problem, I couldn't find a fix. The error occures in line 20 (AttributeError: 'bytes' object has no attribute 'timeout'). I don't fully understand the error, so I'm looking for an answer and an explanation of what I did wrong. Thanks!