0

It is time for the first one here :)

Currently working with Tripadvisor (retrieving with rvest and RSelenium) and want to get information about each particular review evaluation on pages of users. Unfortunately, not every review has an attribute "Helpfull vote". Therefore, when i try to combine the dataframe i have an error that "arguments imply differing number of rows: 31, 3". So I think, i have to manage to get NAs instead of missing values for non-evaluated reviews but my attempts have been not successful so far.

How it looks on a tripadvisor

HTML

My code example:

`

likes <- url %>%
  html_nodes(".social-statistics-bar-SocialStatisticsBar__item--2IlT7") %>%
  html_text()
reviewdates <- url %>%
  html_nodes(".social-member-event-MemberEventOnObjectBlock__item--2PXOx .ui_link") %>%
  html_text()
    data<-data.frame(likes, review dates)`

Thank you in advance

UPD: Big Thanks for everybody for spending some time for my question! Yeah. It sounds legit also. However I found this kind of solution by @BjaRule and it worked. Scraping with rvest - complete with NAs when tag is not present

  • Does this answer your question? https://stackoverflow.com/questions/45901532/inputting-na-where-there-are-missing-values-when-scraping-with-rvest – QHarr Apr 18 '20 at 00:16
  • Thank you! Yeah. It sounds legit also. However I found this kind of solution by @BjaRule and it worked. https://stackoverflow.com/questions/33250826/scraping-with-rvest-complete-with-nas-when-tag-is-not-present/33416181#33416181 Big thanks to everybody for spending some time for my question) – Sergey Kolesnik Apr 18 '20 at 00:59

0 Answers0