How to read an html table using Rselenium?

后端 未结 2 1721
梦谈多话
梦谈多话 2020-12-31 10:01

I\'m using Rselenium to navigate to a webpage. The following code is doing so. I haven\'t provided the url because I\'m using the url in a company which needs vpn to connect

相关标签:
2条回答
  • 2020-12-31 10:45

    Something like:

    library(XML)
    doc <- htmlParse(remDr$getPageSource()[[1]])
    readHTMLTable(doc)
    

    should allow you to access the html and process the tables contained.

    0 讨论(0)
  • 2020-12-31 10:54

    I prefer using rvest, so what I did was:

    # Importing libraries
    library(RSelenium)
    library(rvest)
    
    # Extracting table
    remDr$getPageSource()[[1]] %>% 
      read_html() %>%
      html_table()
    
    0 讨论(0)
提交回复
热议问题