I cannot get my program to work, and I have tried for so long. Here it is, pretty simple but I cannot get it. Supposed to return anything containing "html" in it. It is really frustrating. This is for command line python 2.x
#!/usr/bin/env python
import sys
import re
#Make this program work both on python 2.x and Python 3.x
if (sys.version_info[0] == 3): raw_input = input
import urllib2
url = urllib2.urlopen('http://makeitwork.com/')
data = url.read()
urlsearch = re.findall(r'href=[\'"]?([^\'"]+)' , data)
for x in urlsearch:
line = x.split()
print(" %s" %line[0])