Open erichuang888 opened 2 years ago
Hi 您好, 這屬於Warnings.其實Warnings並不是錯誤,只是一種提醒或警告. 應該是因為我的套件版本比您的舊,所以我沒有跳出這個警告.
例如它字面告您的,他建議您在BeautifulSoup()方法中,指定解析器為lxml. 遇到WARNINGS通常有三種選項:
import warnings
warnings.filterwarnings('ignore')
已順利解決,謝謝
不會, 歡迎您隨時提出討論.
您好: 之前按照書本在爬蟲抓取股價資料時,發現會出現下列文字 /Users/mac/Documents/spyder/yahoo_price.py:23: GuessedAtParserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.
The code that caused this warning is on line 23 of the file /Users/mac/Documents/spyder/yahoo_price.py. To get rid of this warning, pass the additional argument 'features="lxml"' to the BeautifulSoup constructor.
soup = BeautifulSoup(data.text) Traceback (most recent call last): 請問是什麼問題呢?我是使用mac同時是搭配spyder編譯器