James Matthews wrote: > The function just overwrites the list in my function is there anyway i > can fix this! > def find_all_items(site): > site = urllib.urlopen(site).read() > all_items = re.findall(r'watch\.asp\?\w+\=\w*\&\w*\=\w+',site) > next_page = re.findall(r'Watches\.asp\?\w+\=[0-9]+\&pg\=\w+',site) > try: > find_all_items(urllib.basejoin("<some url>",next_page[0])) > except IndexError: > pass > return remove_dups(all_items) # ,<---- this removes all the > duplicate items
Actually, it doesn't overwrite the list. You just don't do anything with the list that is returned from the call inside the function. Remember that site, all_items, and next_page are LOCAL variable; they exist only inside that one function call. Every time you call find_all_items, you get a brand new instance of all_items. try: all_items.extend( find_all_items( urllib.basejoin("<some url>",next_page[0] ) ) -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32