[問題] 新手請教爬蟲

作者: lovex (L O V E X)   2020-09-01 17:26:32
新手學習爬蟲中~
請問如以下的學校公告欄
http://www.cshs.kh.edu.tw/post/book.asp
soup = BeautifulSoup(html, 'html.parser')
for link in soup.find_all(href=re.compile("view")):
print(link.get('href'))
這樣可以抓到內文實際的連結,但不知如何抓細節
主要想抓整個table把新的資料寫入sql db, 不知道怎麼抓好呢?
(因為它的table都沒有id 或 class之類的~)
(新增資料
作者: panex0845 (胖克思)   2020-09-01 19:44:00
整個表格也沒幾行 把網頁抓下來做字串分析就行了
作者: chickengod (雞大俠)   2020-09-01 20:11:00
有 table 的話 用 soup 抓出 table 餵給 pandas不過這網頁有 RSS 的話 直接用 feedparser就不需要自己處理網頁

Links booklink

Contact Us: admin [ a t ] ucptt.com