I am trying to create a program to pull all the links from a webpage and put them into a list.
import urllib.request as ur
#user defined functions
def findLinks(website):
links = []
line = website.readline()
while 'href=' not in line:
line = website.readline()
p
while '</a>' not in line :
links.append(line)
line = website.readline()
#connect to a URL
website = ur.urlopen("https://www.cs.ualberta.ca/")
findLinks(website)
When I run this program it delays and returns a TypeError : string does not support buffer interference.
Anyone with any pointers?