title: BeautifulSoup4: Fail to find 'a' tag with specific href value by find()
body: <p>I am trying to crawl the realtime Bitcoin-HKD Currency from <a href="https://www.coinbase.com/pt-PT/price/" rel="nofollow noreferrer">https://www.coinbase.com/pt-PT/price/</a> with python3.</p>
  <p>The only way I found to locate it specificly in the HTML is by this tage <strong>a</strong> with <strong>href=&quot;/pt-PT/price/bitcoin&quot;</strong></p>
  <pre><code>    &lt;a href=&quot;/pt-PT/price/bitcoin&quot; title=&quot;Visite a moeda Bitcoin&quot; data-element-handle=&quot;asset-highlight-top-daily-volume&quot; class=&quot;Link__A-eh4rrz-0 hfBqui AssetHighlight__StyledLink-sc-1srucyv-1 cbFcph&quot; color=&quot;slate&quot;&gt;
                                 &lt;h2 class=&quot;AssetHighlight__Title-sc-1srucyv-2 jmJxYl&quot;&gt;Volume mais alto (24 h)&lt;/h2&gt;
                                 &lt;div class=&quot;Flex-l69ttv-0 gaVUrq&quot;&gt;
                                    &lt;img src=&quot;https://dynamic-assets.coinbase.com/e785e0181f1a23a30d9476038d9be91e9f6c63959b538eabbc51a1abc8898940383291eede695c3b8dfaa1829a9b57f5a2d0a16b0523580346c6b8fab67af14b/asset_icons/b57ac673f06a4b0338a596817eb0a50ce16e2059f327dc117744449a47915cb2.png&quot; alt=&quot;Visite a moeda Bitcoin&quot; aria-label=&quot;Visite a moeda Bitcoin&quot; loading=&quot;lazy&quot; class=&quot;AssetHighlight__AssetImage-sc-1srucyv-5 lcjcxh&quot;/&gt;
                                    &lt;div class=&quot;Flex-l69ttv-0 kvilOX&quot;&gt;
                                       &lt;div class=&quot;Flex-l69ttv-0 gTbYCC&quot;&gt;
                                          &lt;h3 class=&quot;AssetHighlight__SubTitle-sc-1srucyv-3 gdcBEE&quot;&gt;Bitcoin&lt;/h3&gt;
                                          &lt;p class=&quot;AssetHighlight__Price-sc-1srucyv-4 bUAWAG&quot;&gt;460 728,81 HK$&lt;/p&gt;
  </code></pre>
  <p>Here <strong>460 728,81 HK$</strong> is the data wanted.</p>
  <p>Thus I applied the following codes:</p>
  <pre><code>    import bs4
  
      import urllib.request as req
      url=&quot;https://www.coinbase.com/prthe ice/bitcoin/hkd&quot;
      
      request=req.Request(url,headers={
          &quot;user-agent&quot;:&quot;...&quot;
          })
      with req.urlopen(request) as response:
          data=response.read().decode(&quot;utf-8&quot;)
      
      root=bs4.BeautifulSoup(data,&quot;html.parser&quot;)
      secBitcoin=root.find('a',href=&quot;/pt-PT/price/bitcoin&quot;)
      realtimeCurrency=secBitcoin.find('p')
      print(realtimeCurrency.string)
  </code></pre>
  <p>However, it always returns secBitcoin = None. No result matches.</p>
  <p>The find function works just fine when I search 'div' label with class parameter.</p>
  <p>I have also tried format like</p>
  <pre><code>.find('a[href=&quot;/pt-PT/price/bitcoin&quot;]')
  </code></pre>
  <p>But nothing works.</p>