title: Extracting the href link of a tr value in Python beautifulsoup
body: <p>The code snippet below is working. As part of improving it, I wanted to extract the href link and add it to the list of data being displayed.</p>
  <pre><code>import requests
  from bs4 import BeautifulSoup
  from itertools import groupby
  
  url = &quot;https://bscscan.com/tokentxns&quot;
  
  soup = BeautifulSoup(requests.get(url).content, &quot;html.parser&quot;)
  
  data = []
  for tr in soup.select(&quot;tr:has(td)&quot;):
      tds = [td.get_text(strip=True) for td in tr.select(&quot;td&quot;)]
      _, txn_hash, tm, age, from_, _, to_, value, token = tds
      data.append((token, value, txn_hash))
  
  data = sorted(data)
  for _, g in groupby(data, lambda k: k[0]):
      g = list(map(list, g))
      for subl in g[1:]:
          subl[0] = &quot;&quot;
  
      for subl in g:
          print(&quot;{:&lt;27} {:&lt;27} {:&lt;60}&quot;.format(*subl))
      print()
  </code></pre>
  <p>Current Output:</p>
  <pre><code>    Wrapped BNB (WBNB)      0.013344799772136381        0xe45d252ffd82e6720ea1993f95670bb03f130fbe129800d0353e6a54b47f1ab1
                              0.01534839792812691         0x2a6519d13e3bed1b14724a3712a10ee902941c1de9c1fc23f81c438a6954e353
                              0.018368                    0x9cc3beff8b8e70a265fca4f3c95eb5ef3ea01a8731241a22214f0c25e61effa3
                              
      CryptoBlades...(SKILL)  0.971749999999999991        0x885026cd5c6aa9788bc1ef37b4d94f185384d2fcf31a8f44e605bd597b41c9d8
                              0.971749999999999991        0xe0afde7005bde28039ee2ab9c9260df4feed43ec904870c796fa197a12ded1d4
                              0.971749999999999991        0xe94a019d6e473a5485bff9e3e732a9bb9f7e35d4d040cea1866463d771ffbd42
  </code></pre>
  <p>Improvements Needed: # add the href link of the token name (link, token, values, txnhash)</p>
  <pre><code>    https://bscscan.com/token/0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c    Wrapped BNB (WBNB)      0.013344799772136381        0xe45d252ffd82e6720ea1993f95670bb03f130fbe129800d0353e6a54b47f1ab1
                                                                                                      0.01534839792812691         0x2a6519d13e3bed1b14724a3712a10ee902941c1de9c1fc23f81c438a6954e353
                                                                                                      0.018368                    0x9cc3beff8b8e70a265fca4f3c95eb5ef3ea01a8731241a22214f0c25e61effa3
                              
      https://bscscan.com/token/0x154a9f9cbd3449ad22fdae23044319d6ef2a1fab    CryptoBlades...(SKILL)  0.971749999999999991        0x885026cd5c6aa9788bc1ef37b4d94f185384d2fcf31a8f44e605bd597b41c9d8
                                                                                                      0.971749999999999991        0xe0afde7005bde28039ee2ab9c9260df4feed43ec904870c796fa197a12ded1d4
                                                                                                      0.971749999999999991        0xe94a019d6e473a5485bff9e3e732a9bb9f7e35d4d040cea1866463d771ffbd42
  </code></pre>