[問題] 新手請教爬蟲
新手學習爬蟲中~
請問如以下的學校公告欄
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之類的~)
(新增資料--這會搭配Windows每日執行task)
謝謝!
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.192.193.194 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1598952395.A.09E.html
→
09/01 19:44,
4年前
, 1F
09/01 19:44, 1F
→
09/01 20:11,
4年前
, 2F
09/01 20:11, 2F
→
09/01 20:12,
4年前
, 3F
09/01 20:12, 3F
→
09/01 20:12,
4年前
, 4F
09/01 20:12, 4F
Python 近期熱門文章
PTT數位生活區 即時熱門文章