Difficulty using rvest while scraping data from web

Hi guys.

I am trying to import some tables from websites. I'm learning the rvest package. I manage to use it perfectly when I try it in wikipedia. But I fail in other websites. I am trying to import race results from various marathons.

Here is an example of my code and I recieve empty lists:

london <- read_html"Virgin Money London Marathon 2019"
resultstable <- html_elements("#cbox-main")

I have tried using many other selectors as well, none of them worked. (I'm not familiar with html language.) I also tried the selector gadget, which I couldn't manage either.

Although I already fail to copy the main data, I am also interested in scraping further data, such as the ones you get when you click on names on the main list : Virgin Money London Marathon 2019

Can you possibly help me?
Thanks

Hello Murat,

I am not sure what is happening at your site but I have no empty list problem.
Maybe using the following syntax helps:

library(rvest)
london <- read_html("https://results.virginmoneylondonmarathon.com/2019/?pid=search")
resultstable <- html_elements(london,"#cbox-main")

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.