嘗試使用 data-reactid 標(biāo)記在雅虎財經(jīng)中搜索一個數(shù)字,但我得到了一個SyntaxError: keyword can't be an expression. 我的代碼:Walmart stocksource = requests.get('https://finance.yahoo.com/quote/WMT?p=WMT&.tsrc=fin-srch').textsoup = BeautifulSoup(source, 'lxml')price = soup.find('span', data-reactid_='35')print("Walmart stock: " + price.text)
BeautifulSoup data-reactid Python
ibeautiful
2021-08-14 21:25:02