<p>它在一个json字符串中,所以很难找到它</p>
<pre><code>html = """
<h3>
<a href="/freeCodeCamp/freeCodeCamp" class="v-align-middle"data-hydro-click="{&quot;event_type&quot;:&quot;search_result.click&quot;,&quot;payload&quot;:{&quot;page_number&quot;:1,&quot;query&quot;:&quot;stars:>1&quot;,&quot;result_position&quot;:1,&quot;click_id&quot;:28457823,&quot;result&quot;:{&quot;id&quot;:28457823,&quot;global_relay_id&quot;:&quot;MDEwOlJlcG9zaXRvcnkyODQ1NzgyMw==&quot;,&quot;model_name&quot;:&quot;Repository&quot;,&quot;url&quot;:&quot;https://github.com/freeCodeCamp/freeCodeCamp&quot;},&quot;originating_request_id&quot;:&quot;EB94:4DE3:1D61C50:2AEAFBA:5A8D8E31&quot;}}" data-hydro-hmac="2b170325f8ff481731dd5f65d85e7e94a356f75bdafce1f9c5cc60d112cbc2f8">freeCodeCamp/freeCodeCamp</a>
</h3>
"""
soup = BeautifulSoup(html, 'lxml')
parsed_json = json.loads(soup.a.get('data-hydro-click'))
parsed_json['payload']['result']['url']
# returns 'https://github.com/freeCodeCamp/freeCodeCamp'
</code></pre>