我的问题是是否有可能获得一个在这样的范围内的数字:
<html junk>
<div class="test">
<span>
55
</span>
</div>
</html junk>
正如您所看到的,span 没有类或 id。
我当前的代码只是抓取工具的默认代码(删除了用户代理和 URL):
import requests
from bs4 import BeautifulSoup
URL = ''
headers = {"User-Agent": ''}
page = requests.get(URL, headers=headers)
soup = BeautifulSoup(page.content, 'html.parser')
#Here is where the "55" should be found (the number is going to change over time so im not excactly looking for it
title = soup.find('')
print(title)
UYOU
相关分类