Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 从标记中提取文本<;部门>;_R_Rvest - Fatal编程技术网

R 从标记中提取文本<;部门>;

R 从标记中提取文本<;部门>;,r,rvest,R,Rvest,我想从此页提取标签下的所有信息 我试着 库(rvest) 阅读html(“http://www.inmet.gov.br/sonabra/maps/pg_mapa.php") %>% html_节点(xpath='/*[@id=“side_bar”]”) #{xml_nodeset(1)} # [1] 但是我无法访问侧栏中的任何内容名称。我认为那里没有任何内容。您需要的信息位于的上方。使用浏览器的“查看源代码”功能。Paging@hrbrmstr:也许这个答案会有帮助:谢谢@42-,我检

我想从此页提取标签
下的所有信息

我试着

库(rvest)
阅读html(“http://www.inmet.gov.br/sonabra/maps/pg_mapa.php") %>% 
html_节点(xpath='/*[@id=“side_bar”]”)
#{xml_nodeset(1)}
# [1] 

但是我无法访问
侧栏中的任何内容
名称。

我认为那里没有任何内容。您需要的信息位于的上方。使用浏览器的“查看源代码”功能。Paging@hrbrmstr:也许这个答案会有帮助:谢谢@42-,我检查了答案,但我仍然不明白发生了什么。如果你查看php引擎交付的页面,所有数据都“在你提取的html代码主体之上”(我想)php引擎首先制作地图和侧栏,然后才命名为“侧栏”。是的!!很好,我得到了。谢谢。
library(rvest)

read_html("http://www.inmet.gov.br/sonabra/maps/pg_mapa.php") %>% 
  html_nodes(xpath = '//*[@id="side_bar"]')
   # {xml_nodeset (1)}
   # [1] <div id="side_bar"></div>