0
我需要獲取以下屏幕截圖中顯示的文本2,585
。我很新的編碼,但這是我到目前爲止:如何使用BeautifulSoup和Python獲取表格/跨度後的文本?
import urllib2
from bs4 import BeautifulSoup
url= 'insertURL'
r = requests.get(url)
data = r.text
soup = BeautifulSoup(data, 'html.parser')
span = soup.find('span', id='d21475972e793-wk-Fact -8D34B98C76EF518C788A2177E5B18DB0')
print (span.text)
任何信息是有幫助的!謝謝。