【发布时间】:2020-03-25 23:07:51
【问题描述】:
有人知道我是否可以用 httr 和 rvest 刮掉这个 site 或 this one,还是应该使用 selenium 或 phantomjs?
这两个网站似乎都在使用 ajax,我似乎无法通过它。
基本上我所追求的是以下内容:
# I want this to return the titles of the listings, but I get character(0)
"https://www.sahibinden.com/satilik" %>%
read_html() %>%
html_nodes(".searchResultsItem .classifiedTitle") %>%
html_text()
# I want this to return the prices of the listings, but I get 503
"https://www.hurriyetemlak.com/konut" %>%
read_html() %>%
html_nodes(".listing-item .list-view-price") %>%
html_text()
欢迎任何关于 v8 或人工会话的想法。
此外,也欢迎任何纯粹的 curl 解决方案。稍后我会尝试将它们翻译成 httr :)
谢谢
【问题讨论】:
-
你想要的输出是什么?尽量准确 - 例如:“Referanz Ankara 199.000 TL”
-
@TonioLiebrand 我已经更新了问题
标签: r web-scraping rvest httr rselenium