title: Finding text not present in a string
body: <p>As you can see I have two variables defined: a variable named <code>href</code> which has multiple links as one string and a variable named <code>text</code>, now in <code>text</code> I have the links that I have already visited/downloaded from. I want Python to print the text that is present in <code>href</code> but not in <code>text</code>.</p>
  
  <p>So I imagine its using a for loop?</p>
  
  <p>When I execute single letters get returned, all separated on a different line.</p>
  
  <pre><code>import requests
  from bs4 import BeautifulSoup
  
  url = 'amazon.com'
  source_code = requests.get(url)
  plain_text = source_code.text
  soup = BeautifulSoup(plain_text, 'html.parser')
  
  for link in soup.findAll('a', {'class': 'gridItem-trackInfo-title-anchor'}):
      href = link.get('href')
  
      file = open('file.txt', 'r')
      text = file.read()
      file.close
  
      for i in href:
          if i not in text:
              print(i)
  </code></pre>