擅长:python、mysql、java
<p>可以使用在脚本中加载iframe的URL。然后你只得到一个没有拐杖的小部件。为此,获取原始URL并附加一个查询字符串“embed=1”。在</p>
<pre><code>import requests
from bs4 import BeautifulSoup
url = 'https://t.me/dayygesstt/956?embed=1'
r = requests.get(url)
soup = BeautifulSoup(r.text, "html.parser")
views = soup.find("span", {"class": "tgme_widget_message_views"})
print(views.text)
</code></pre>