在表格前提取文字
我想从XML文件中的表格上提取一两行的子头。例如,在此网页上: https://en.wikipedia.orgg/wikipedia.org/wiki/cost_database
有几张表,我可以使用库(XML)和R代码来提取它们的标题,并提供 https://rud.is/b/2015/08/23/ususe-r-t-tem-te-data-data-und- 。
现在,我想在表上方一行索引并获取相应的文本 有一个好方法吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用rvest软件包进行此操作以获取网页中的第一个段落:
selectorgadget 可以帮助识别正确的元素名称对于HTML页面。
由
创建获取Word文档的第一段:
由
You could do this using the rvest package to get the first paragraph in the web page:
selectorgadget can help identify the right element name for the html page.
Created on 2022-06-18 by the reprex package (v2.0.1)
To get the first paragraph of a Word document:
Created on 2022-06-18 by the reprex package (v2.0.1)