I wonder why the for loop is not extending it’s iteration:
for link in frontLinks:
#try:
getCurlink = self.getHref(link) # get current site links
#print getCurlink
#print frontLinks
if getCurlink:
frontLinks = frontLinks + getCurlink
This line:
frontLinks = frontLinks + getCurlink
doesn’t apply to frontLinks of the “for” loop. Any ideas??
The for loop evaluates its expression once, to get an iterator. Later, you re-bind the name
frontLinksto be a new list. The new list won’t have anything to do with the for loop.Although it is tricky to modify a list while iterating over it, it’s OK to add to the end of the list, it will work. Change your last line to this: