9

I'm new to rvest and I'm trying to determine if its possible to use rvest to click a tab that activates a div so that data can be scraped. I've been reading the rvest documentation on cran and have not read anything that talks about clicking links, buttons or tabs.

The site that I'm interested in scraping is: touch.tvg.com

From the home page I'd like to click the race button (Again, how do you clik buttons in rvest)

Next, I'd like to select an upcoming race. This should redirect me to the selected race's url. For example: The 10th race at Hoosier

Once one the race page, I'd like to click the Pool tab and scrape the pool information.

I've attached some screen shots below. Any suggestion, guidance is appreciated.

From Home Page - Click Races Button Home Page - Click Races

From Races Page - Click an upcoming Race Races Page - Click an upcoming race

From The Particular Race Page - Click The Pool Tab From the Race Page - Click the pool tab

With the Pool data (Div) visible - Scrape the Pool Data. With Pool data visible - Scrape Pool Data

Mutuelinvestor
  • 3,020
  • 7
  • 36
  • 66
  • 1
    No. You'd need RSelenium, which is a little complicated. – alistaire Jul 14 '16 at 01:23
  • 1
    If you figure this out will you be able to predict which horse is going to win? – Hack-R Jul 14 '16 at 02:02
  • @Hack-R I have read some post that indicate it is possible to accomplish this with rvest. As I recall ( I can't find the article now) the writer suggest using chrome dev tools and network to identify what's being sent to the server and then basically replicate it. I don't know if that applies to the divs on this page. – Mutuelinvestor Jul 14 '16 at 23:17
  • @Mutuelinvestor That sounds about right. – Hack-R Jul 15 '16 at 00:53
  • Mutuelinvestor - Would you accept an `RSelenium` answer? – Technophobe01 Jul 18 '16 at 05:05
  • 1
    You can check this url https://touch.tvg.com/ajax/races/track/GB1/performance/Day/get/collection for (GB1 needs to be replaced by the race you are interested in), it has all the data for all the days of each race. Also, is scraping allowed in their TOS? – NicE Jul 19 '16 at 14:28
  • 1
    It looks like this is about solving the problem that this Upwork job poses: https://www.upwork.com/jobs/_~017b02239f5c37db01/. – matt_jay Jul 20 '16 at 00:02
  • @NicE would you like to turn your comment into an answer. – Mutuelinvestor Jul 20 '16 at 23:58

1 Answers1

3

RSelenium seems to offer all the functionality needed to harvest the data of interest. The best results might be achieved by combining the strength of rselenium with those of rvest.

Thank to everyone for their comments.

Mutuelinvestor
  • 3,020
  • 7
  • 36
  • 66