我正在一个项目中,我想要刮这样一个页面,以获得原产地的城市。我试图用CSS选择:” .TYPE-12〜.TYPE-12 + .TYPE-12" 不过我不文本进入R.不是刮掉html源码,而是实际的网站
链接: https://www.kickstarter.com/projects/1141096871/support-ctrl-shft/description
我用rvest和和read_html函数。
但是,看起来源代码中有一些脚本。在脚本返回结果后(如使用浏览器看到的),是否有办法刮掉网站?
PS我看了类似的问题,但没有找到答案..
代码:
main.names <- read_html(x = paste0("https://www.kickstarter.com/projects/1141096871/support-ctrl-shft/description")) # feed `main.page` to the next step
names1 <- main.names %>% # feed `main.page` to the next step
html_nodes("div.mb0-md") %>% # get the CSS nodes
html_text()# extract the text
此api不提供有关该项目的原产国或其他信息的任何信息。或者我错过了什么?我看到的唯一可能性与行动或维护更新有关。 – nemja
http://syntaxi.net/2013/03/24/let-s-explore-kickstarter-s-api/ https://github.com/markolson/kickscraper 再次。你使用什么工具?随着BeatifulSoup(它的Python不是R),我可以获得信息。 – hansTheFranz
我正在使用R:main.names < - read_html(x = paste0(“https://www.kickstarter.com/projects/1141096871/support-ctrl-shft/description”))#feed'main.page'下一步 names1 < - main.names%>%#feed'main.page'到下一步 html_nodes(“div.mb0-md”)%>%#获取CSS节点 html_text()#extract电影名称(请参阅编辑) – nemja