-3

尝试了同样的方法,没有成功

import bs4
import requests
from bs4 import BeautifulSoup
import urllib.request

#data I want to pull then push a while loop to get it regularly by the minute
r = requests.get('https://finance.yahoo.com/quote/MSFT?p=MSFT&.tsrc=fin-srch') 
soup = BeautifulSoup(r.text, 'xml')
print(soup)
4

1 回答 1

0

请检查文档:

https://www.crummy.com/software/BeautifulSoup/bs4/doc/

您需要调用汤对象的函数。例如:

print(soup.get_text())
于 2020-03-03T21:16:00.270 回答