看板 [ Python ]
討論串[問題] BeautifulSoup中搜尋中文
共 4 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者alvin17 (alvin17)時間17年前 (2008/02/13 02:50), 編輯資訊
1
0
0
內容預覽:
我想用BeautifulSoup來parse含有中文的頁面 但是一直出錯. parse.py該段的code如下:. soup = BeautifulSoup.BeautifulSoup(page, fromEncoding="utf-8"). searchlist = soup.html.body(
(還有529個字)

推噓3(3推 0噓 5→)留言8則,0人參與, 最新作者StubbornLin (Victor)時間17年前 (2008/02/13 08:28), 編輯資訊
1
0
2
內容預覽:
我記得第二個參數應該是吃dictinoary的吧?. 還有參數的值改成unicode比較正確吧?. 試試. soup.findAll('img', dict(title=u'統計')). --. VICTOR工作室 http://www.kinmen.info/vic/. 程式設計教學 http:/

推噓1(1推 0噓 1→)留言2則,0人參與, 最新作者alvin17 (alvin17)時間17年前 (2008/02/13 20:54), 編輯資訊
1
0
0
內容預覽:
抱歉又來麻煩大大. 網頁中有以下tag. <div class="A">. .... </div>. 但是用soup.findAll('div', dict(class='A'))會出錯. 因為class是關鍵字 Q_Q. 請問大大可以怎麼避掉嗎?. 謝謝. --. 發信站: 批踢踢實業坊(pt

推噓2(2推 0噓 0→)留言2則,0人參與, 最新作者StubbornLin (Victor)時間17年前 (2008/02/13 21:11), 編輯資訊
0
0
3
內容預覽:
dict只是方便產生Dictionary的一個函數而已. 遇到關鍵字當然是死路一條,非用Dictionary不可. Dictionary怎麼寫 請看. http://victorlin.serveftp.org/programming/article/?article_id=34. --. VICT
首頁
上一頁
1
下一頁
尾頁