title: Item in list found but when I ask for location by index it says that the item can't be found
body: <p>I am writing some code to get a list of certain counties in Florida for a database. These counties are listed on a website but are each on individual webpages. To make the collection process less tedious I am writing a webscraper. I have gotten the links to all of the websites with the counties. I have written code that will then inspect the website, find the line that says &quot;COUNTY:&quot; and then I want to get the location so I can actually get the county on the next line. The only problem is when I ask for the location it says it can't be found. I know it is in there because when I ask my code to find it and then return the line (Not the placement) it doesn't return empty. I will give some of the code for reference and an image of the problem.</p>
  <p>Broken code:</p>
  <pre><code>links = ['https://www.ghosttowns.com/states/fl/acron.html', 'https://www.ghosttowns.com/states/fl/acton.html']
  import requests
  r = requests.get(links[1])
  r = str(r.text)
  r = r.split(&quot;\n&quot;)
  county_before_location = [x for x in r if 'COUNTY' in x]
  print(county_before_location)
  print(r.index(county_before_location))
  </code></pre>
  <p>Returns:</p>
  <pre><code>['    &lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#80ff80&quot;&gt;COUNTY:&lt;/font&gt;&lt;font color=&quot;#ffffff&quot;&gt;'] is not in list
  </code></pre>
  <p>Code that shows the item:</p>
  <pre><code>links = ['https://www.ghosttowns.com/states/fl/acron.html', 'https://www.ghosttowns.com/states/fl/acton.html']
  import requests
  r = requests.get(links[1])
  r = str(r.text)
  r = r.split(&quot;\n&quot;)
  county_before_location = [x for x in r if 'COUNTY' in x]
  print(county_before_location)
  </code></pre>
  <p>Returns:</p>
  <pre><code>['    &lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#80ff80&quot;&gt;COUNTY:&lt;/font&gt;&lt;font color=&quot;#ffffff&quot;&gt;']
  </code></pre>
  <p><a href="https://i.stack.imgur.com/uaDfQ.png" rel="nofollow noreferrer">Photo</a></p>