# last_page = soup.find(string = re.compile('No Listings Found'))#this is present in all pages that don't have a full 48 listings on them. So you end up with an empty price list becuase of your conditional statement
total_results=str(len(used_sold_list)+len(new_sold_list))+' Total Results'
end=time.time()
print(end-start,'seconds')
print('Average Used Sold Price',average_used_sold_price,used_sold_results)
print('Average New Sold Price',average_new_sold_price,new_sold_results)
print(total_results)
if__name__=='__main__':
page_list=list(range(1,5))
all_sold_list=[]
new_sold_list=[]
main()
'''to speed up the program you can include a few things: 1) only parse the total results and sift for the NWT listings to create a separate NWT list 2) Implement processpoolexecutor to use more than one worker to parse the pages 3) find a better way to find the last page so you don't have to make more requests than necessary. This could be either taking the "smallest""no listings found" page of the pages while excluding the others after the smallest one is found. Or, determining from the request headers whether a page is worth downloading or not 4) using a while loop in chunks of 2-4 pages to find the last page in conjunction with number 3'''