title: Beautiful Soup, conditionally extracting Href
body: <p>From a given selection of webpages, I am trying to extract links from a table, conditional on the &quot;document type&quot; information being something specific. For example, on this website, I only want to get the Href if the document type is &quot;Technical Assistance Reports&quot;.</p>
  <p><a href="https://i.stack.imgur.com/HECvE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HECvE.png" alt="enter image description here" /></a></p>
  <p>When I use google to inspect it, I see this:</p>
  <p><a href="https://i.stack.imgur.com/j4vth.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j4vth.png" alt="enter image description here" /></a></p>
  <p>But When I use BeautifulSoup, I can find the Href but I am unable to find the text that says &quot;Technical Assistance Reports&quot;.</p>
  <pre><code>import requests
  url2 = &quot;https://www.adb.org/projects/54128-001/main#project-documents&quot;
  response = requests.get(url2)
  from bs4 import BeautifulSoup
  soup = BeautifulSoup(response.text)
  #print(soup.prettify())
  parent = soup.find_all('tr')
  parent[1].find_all('td')
  </code></pre>
  <p>I get this:</p>
  <pre><code>[&lt;td&gt;
   &lt;a href=&quot;/projects/documents/reg-54128-001-tar&quot;&gt;Implementing the Cities Development Initiative for Asia: Technical Assistance Report&lt;/a&gt; &lt;/td&gt;,
   &lt;td class=&quot;width-2-12 views-field views-field-field-date-content&quot;&gt;
   &lt;span class=&quot;date-display-single&quot; content=&quot;2020-09-30T00:00:00+08:00&quot; datatype=&quot;xsd:dateTime&quot; property=&quot;&quot;&gt;Sep 2020&lt;/span&gt; &lt;/td&gt;]
  </code></pre>
  <p>The Href is there and the date is there but I can't find the text &quot;Technical Assistance Reports&quot;. The middle &quot;td&quot; isn't showing up.</p>
  <p>This example only has the one document listed on the webpage but other examples may have many or none. Ideally, I would like to be able loop through all the &quot;tr&quot; and only pick up the Href if the document type is &quot;Technical Assistance Report&quot; or other stuff that I am looking for. What am I doing wrong here and what's a good way to accomplish this?</p>