[問題] 爬蟲問題
[問題類型]:
程式諮詢(我想用R 做某件事情,但是我不知道要怎麼用R 寫出來)
[軟體熟悉度]:
使用者(已經有用R 做過不少作品)
[問題敘述]:
平常是很少爬蟲 之前有在爬的時候也算是順利
今天臨時把之前爬過的東西翻出來要抓資料
網頁如下:
http://ntpc.youbike.com.tw/cht/f12.php?loc=taipei
但之前爬得很順利的東西(兩年前)
今天突然抓不下來
爬文以及google一下 似乎是Keep-Alive Connection的問題
也許這兩年內這網站加上這東西
google了一下相關的資訊還是無法爬成功
只好上來請教各位先進
[程式範例]:
library(magrittr)
library(httr)
library(rvest)
library(stringr)
# 例如我要抓這網頁可停空位那一欄
ubikeurl <- "http://ntpc.youbike.com.tw/cht/f12.php?loc=taipei"
urlubike <- read_html(ubikeurl)
ubike <- urlubike %>%
html_nodes(., xpath = "//tr/td[4]") %>%
html_text
[環境敘述]:
R version 3.4.0 (2017-04-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
[關鍵字]:
選擇性,也許未來有用
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.34.124.238
※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1497454783.A.636.html
※ 編輯: cd12631 (1.34.124.238), 06/14/2017 23:41:01
→
07/02 12:44, , 1F
07/02 12:44, 1F
→
07/02 12:45, , 2F
07/02 12:45, 2F
→
07/02 12:48, , 3F
07/02 12:48, 3F
→
07/02 12:49, , 4F
07/02 12:49, 4F
→
07/02 12:49, , 5F
07/02 12:49, 5F
討論串 (同標題文章)
R_Language 近期熱門文章
PTT數位生活區 即時熱門文章