title: Fastest way to find an item in a collection
body: <p>Right now my I have a script which parses all of the items, places it into a collection (currently a list which is slow), and then I want to return the element that matches a list of keywords that I've inputted beforehand. </p>
  
  <p>What would be the best type of collection for this purpose and is there any way i can find my desired element without having to loop through the whole collection? </p>
  
  <p>Thank you. </p>
  
  <p>Edit:</p>
  
  <p>An example <a href="http://deadstock.ca/sitemap_products_1.xml" rel="nofollow noreferrer">sitemap</a></p>
  
  <pre><code>def parse(sitemap):
      req = urllib.request.urlopen(sitemap)
      soup = BeautifulSoup(req, 'xml')
      soup.prettify()
      inventory_url = []
  
  
      for item in soup.find_all('url'):
  
  
          inventory_url.append(item.find('loc').text)
  
  
          #matches all keywords
          #keywords is a list of string
      for item in inventory_url:
          if all(kw in item for kw in keywords):
              return item
  </code></pre>