title: how to extract href attribute of ‘a’ element using id= instead of class name
body: <p>I have the following:</p>
  
  <pre><code>&lt;div id="header-author" class="some random class"&gt;
          &lt;a id="author-text" class="some random class" href="/page?id=232"&gt;
            &lt;span class="some random class"&gt;
              Hello there
            &lt;/span&gt;
          &lt;/a&gt;
  </code></pre>
  
  <p>and i want to extract only href attributes of id="author-text"
  i cant use class to extract because the class is used by other elements which has href links which i do not want to extract</p>
  
  <p>i have tried this</p>
  
  <pre><code>soupeddata = BeautifulSoup(my_html_code, "html.parser")
  my_data = soupeddata.find_all("a", id= "author-text")
  for x in my_data:
      my_href = x.get("href")
      print(my_href)
  </code></pre>
  
  <p>Thank you in advance and will be sure to upvote/accept answer!</p>