I am trying to create a queue that contains url strings for a simple web crawler. I don't want duplicate items to be added to a queue, so I have created a helper function to check the url to be added to the queue and see if it is already in it. I was trying to use this code (which I modified from a similar stackoverflow question), pages is the queue:
def is_in_url_list(self, url):
return url in self.pages.queue
However, I cannot seem to get this to work. Even when I pass something that should return true, it returns false. Is there a better way to go about this? Thanks!