I am trying to figure out how to only read in each line that is a url from a website, every time I run the code I get the error:
AttributeError: module 'urllib' has no attribute 'urlopen'
My code is below
import os
import subprocess
import urllib
datasource = urllib.urlopen("www.google.com")
while 1:
line = datasource.readline()
if line == "": break
if (line.find("www") > -1) :
print (line)
li = ['www.apple.com', 'www.google.com']
os.chdir('..')
os.chdir('..')
os.chdir('..')
os.chdir('Program Files (x86)\\LinkChecker')
for s in li:
os.system('Start .\linkchecker ' + s)