尝试使用 data-reactid 标记在雅虎财经中搜索一个数字,但我得到了一个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)
添加回答
举报
0/150
提交
取消