Extract Links from Webpage using R

前端 未结 3 534
庸人自扰
庸人自扰 2020-12-23 02:07

The two posts below are great examples of different approaches of extracting data from websites and parsing it into R.

Scraping html tables into R data frames usin

3条回答
  •  离开以前
    2020-12-23 02:45

    You might try

    htmlcode = read_html("URL")
    nodes=html_nodes(htmlcode,xpath='//*[contains(@href, "SEARCHTERM")]') %>% html_attr("href")
    df=as.data.frame(as.character(nodes))
    names(df)="link"
    

提交回复
热议问题