title: Python substring checking not working as intended
body: <p>I am writing a simple web scraper in Python, here is the code (so far)</p>
  
  <pre><code>import requests, pprint
  from bs4 import BeautifulSoup
  music = []
  page = requests.get(page_url)
  soup = BeautifulSoup(page.text, "html.parser")
  allTags = soup.find_all('a')
  for tag in allTags:
      toCheck = "www.newgrounds.com/audio/listen/"
      if toCheck in tag:
          music.append([tag.get("href"),tag.contents])
      pprint.pprint(music)
  </code></pre>
  
  <p>When running the following commands in the Python shell (with example inputs):</p>
  
  <pre><code>&gt;&gt;&gt; tag = "&lt;a href=\"//www.newgrounds.com/audio/listen/11853\"&gt;-sunrise-&lt;/a&gt;"
  &gt;&gt;&gt; toCheck = "www.newgrounds.com/audio/listen/"
  &gt;&gt;&gt; toCheck in tag
  True
  </code></pre>
  
  <p>It returns True. But the if statement in the program is never running, even though those example inputs should pass it at some point, as well as other valid inputs. I have used various print statements to verify this.</p>
  
  <p>EDIT - Solved</p>
  
  <p>Replace</p>
  
  <pre><code>if toCheck in tag:
  </code></pre>
  
  <p>With</p>
  
  <pre><code>if toCheck in str(tag):
  </code></pre>