Web Scraping with R - static table

Asked

Viewed 33 times

1

I would like to consolidate the data of a betting site in a database on R.

I’m trying it the way below, but my script doesn’t recognize the columns and rows of the table in fact, only the layout:

library(tidyverse)
library(rvest)   
        

url_base <- "https://www.oddsportal.com/soccer/brazil/copa-do-brasil-2020/results/"

site <- read_html(url_base)

info_ajuste_HTML <- html_nodes(site, "table")

info_ajuste <- html_text(info_ajuste_HTML)
  
lista_tabela <- site %>%
  html_nodes("table") %>%
  html_table(fill = TRUE)

I need the following information:

  1. Team name
  2. Final score of the game
  3. Probabilities

Can you tell me how to fix it?

  • 1

    Hello Sarah, could you please include in the question what error appears to you? And show an example of data.frame that you need?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.