作者il0306 (Taylor)
看板R_Language
標題[問題] 爬蟲問題
時間Tue Nov 10 10:40:44 2020
[問題類型]:
爬蟲爬不出來
[軟體熟悉度]:
R爬蟲新手
[問題敘述]:
想將網站上的文字和數字抓下
https://i.imgur.com/3WRTVVA.jpg
安全不能等之類的文字我抓的到
但就地區和數值抓不下來
都回覆空質
[程式範例]:
url_list = '
https://168.motc.gov.tw/countrydeadhurt/%E8%87%BA%E5%8C%97%E5%B8%8
2?y=100&m=1'
temp = read_html(url_list)
temp %>% html_nodes(xpath = '//*[@id="areaList"]/div')
[環境敘述]:
[關鍵字]:
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 223.137.54.124 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1604976046.A.306.html
※ 編輯: il0306 (223.137.54.124 臺灣), 11/10/2020 10:59:42
※ 編輯: il0306 (223.137.54.124 臺灣), 11/10/2020 11:04:22
→ andrew43: 動態生成的。temp就已經沒有抓到了。試試rselenium 11/10 17:03
→ obarisk: 在 script 裡, html_node("script") grep 清一下再解json 11/11 20:17