Re: [問題] 用R抓取八卦版

看板R_Language作者 (by any other name)時間7年前 (2017/05/10 19:50), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串2/2 (看更多)
因為你沒處理 over18 的 cookie library(RCurl) curl <- getCurlHandle() curlSetOpt(cookie="over18=1", followlocation = TRUE, curl=curl) url <- 'https://www.ptt.cc/bbs/Gossiping/index20865.html' html <- getURL(url, curl=curl) 這樣應該就沒問題了 ※ 引述《iwfmf (i @#$%@#$^$%^ f)》之銘言: : : 再用R爬蟲抓取八卦版,但在getURL 時,抓取的資料為空 : [程式範例]: : : > url : [1] "https://www.ptt.cc/bbs/Gossiping/index20865.html" : > html = getURL(url,ssl.verifypeer = FALSE,encoding="UTF-8") : > html : [1] "" -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 104.155.222.243 ※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1494417036.A.7D9.html

05/11 10:52, , 1F
解決了 感謝您!! 看來是我原本處理over18的寫錯
05/11 10:52, 1F
文章代碼(AID): #1P4lwCVP (R_Language)
討論串 (同標題文章)
文章代碼(AID): #1P4lwCVP (R_Language)