擅长:python、mysql、java
<p><code>data-spectate-link</code>是一个属性。到获取<code>data-spectate-link</code>的值,您需要使用<code>element['data-spectate-link']</code></p>
<p>您可以使用<code>findAll</code>()或CSS选择器<code>select</code>()</p>
<pre><code>replay_url_data =matchdatatr[1].findAll("button",attrs={"class" :"replay_button_super", "data-spectate-link" :True})
print(replay_url_data[0]['data-spectate-link'])
</code></pre>
<p>或Css选择器</p>
<pre><code>replay_url_data =soup.select("button.replay_button_super[data-spectate-link]")
print(replay_url_data[0]['data-spectate-link'])
</code></pre>