NameError: name 'beautifulsoup' is not define

看板Marginalman作者 (夏洛克。福爾摩斯)時間7年前 (2018/12/17 14:12), 7年前編輯推噓4(4010)
留言14則, 8人參與, 7年前最新討論串1/2 (看更多)
--------------------------------------------------------------------------- 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 但我有阿 為啥有問題 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 39.8.13.109 ※ 文章網址: https://www.ptt.cc/bbs/Marginalman/M.1545027179.A.8CE.html

12/17 14:13, 7年前 , 1F
你還在爬蟲喔== 報告還有多久
12/17 14:13, 1F

12/17 14:14, 7年前 , 2F
我要學會這葛==
12/17 14:14, 2F

12/17 14:14, 7年前 , 3F
其他是其次 我想學會==
12/17 14:14, 3F

12/17 14:14, 7年前 , 4F
你怎麼問了一個禮拜還在這個問題 果凍魚不是回你了
12/17 14:14, 4F

12/17 14:14, 7年前 , 5F
12/17 14:14, 5F

12/17 14:14, 7年前 , 6F
有ㄇ 哪篇
12/17 14:14, 6F

12/17 14:16, 7年前 , 7F
喔我知道是哪篇
12/17 14:16, 7F

12/17 14:16, 7年前 , 8F
但我有加 耶
12/17 14:16, 8F

12/17 14:19, 7年前 , 9F
大小寫==
12/17 14:19, 9F

12/17 14:19, 7年前 , 10F
BeautifulSoup≠Beautifulsoup ==
12/17 14:19, 10F
from bs4 import BeautifulSoup html_sample = ' \ <html> \ <body> \ <h1 id="title">Hello World</h1> \ <a href="#" class="link">This is link1</a> \ <a href="# link2" class="link">This is link2</a> \ </body> \ </html>' soup = BeautifulSoup(html_sample, 'html.parser') print(type(soup)) print(soup.text) soup = beautifulsoup(html_paser, 'html.paser') header = soup.select ('h1') print(header) 哪個要大小寫== ※ 編輯: oz5566 (39.8.13.109), 12/17/2018 14:20:28

12/17 14:22, 7年前 , 11F
From BS4 IMPORT bEAUTIFULsOuP
12/17 14:22, 11F

12/17 14:22, 7年前 , 12F
調皮……
12/17 14:22, 12F

12/17 14:25, 7年前 , 13F
你不覺得你的美麗湯長的不太樣嗎
12/17 14:25, 13F

12/17 14:41, 7年前 , 14F
肚子好痛
12/17 14:41, 14F
文章代碼(AID): #1S5pvhZE (Marginalman)
文章代碼(AID): #1S5pvhZE (Marginalman)