Re: NameError: name 'beautifulsoup' is not define
※ 引述《oz5566 (夏洛克。福爾摩斯)》之銘言:
: ---------------------------------------------------------------------------
: NameError Traceback (most recent call last)
: <ipython-input-2-2d9df5aef3d8> in <module>()
: ----> 1 soup = beautifulsoup(html_paser)
: 2 header = soup.select ('h1')
: 3 print(header)
: NameError: name 'beautifulsoup' is not defined
: 奇怪咧
: 我上網看是說 沒有
: from bs4 import BeautifulSoup
: 但我有阿
: 為啥有問題
→ walter741225: 你不覺得你的美麗湯長的不太樣嗎
我剛剛發現ㄌ==
然後驗在世
soup = BeautifulSoup(html_sample, 'html.paser')
header = soup.select('h1')
print(header)
錯誤變這樣==
---------------------------------------------------------------------------
FeatureNotFound Traceback (most recent call last)
<ipython-input-9-a2dfee4a21c9> in <module>()
----> 1 soup = BeautifulSoup(html_sample, 'html.paser')
2 header = soup.select('h1')
3 print(header)
D:\Anaconda3\lib\site-packages\bs4\__init__.py in __init__(self, markup,
features, builder, parse_only, from_encoding, exclude_encodings, **kwargs)
196 "Couldn't find a tree builder with the features
you "
197 "requested: %s. Do you need to install a parser
library?"
--> 198 % ",".join(features))
199 builder = builder_class()
200 if not (original_features == builder.NAME or
FeatureNotFound: Couldn't find a tree builder with the features you
requested: html.paser. Do you need to install a parser library?
好長 三小
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 39.8.13.109
※ 文章網址: https://www.ptt.cc/bbs/Marginalman/M.1545028019.A.10A.html
推
12/17 14:28,
7年前
, 1F
12/17 14:28, 1F
→
12/17 14:28,
7年前
, 2F
12/17 14:28, 2F
→
12/17 14:29,
7年前
, 3F
12/17 14:29, 3F
→
12/17 14:30,
7年前
, 4F
12/17 14:30, 4F
→
12/17 14:40,
7年前
, 5F
12/17 14:40, 5F
推
12/17 15:50,
7年前
, 6F
12/17 15:50, 6F
討論串 (同標題文章)