[問題] beautifulsoup 使用問題

看板Python作者 (yshihyu)時間11年前 (2014/08/02 00:07), 編輯推噓1(101)
留言2則, 1人參與, 最新討論串1/1
https://gist.github.com/anonymous/daf246ebe24e096f8ca0 // 程式碼 https://gist.github.com/anonymous/104dcefed9c426e13816 // 測試資料 Tables = soup.findAll('table') // 濾過出html 所有 table print Tables // 這邊輸出結果會變成html裡面所有 <table></table> 之間資料都出現四份 , 照道理應該只html 裡面所有table都只有一份 想請問一下這是什麼原因造成? 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 175.182.166.218 ※ 文章網址: http://www.ptt.cc/bbs/Python/M.1406909227.A.E80.html

08/02 10:49, , 1F
資料裡main frame是nested table 每次都只剝一層
08/02 10:49, 1F

08/02 12:41, , 2F
做了一個簡單的 給你參考看看http://ideone.com/8YmhzW
08/02 12:41, 2F
文章代碼(AID): #1Jsxihw0 (Python)
文章代碼(AID): #1Jsxihw0 (Python)