I'm trying to get the detailed information about reviewer that wrote a certain review.
The problem is that reviewer's information pop-up, when you move to a certain section. I can do that with selenium.
url<-"https://www.tripadvisor.com/Hotel_Review-g644300-d668891-Reviews-Hotel_Creina-Kranj_Upper_Carniola_Region.html#REVIEWS"
driver<- rsDriver()
remDr <- driver[["client"]]
remDr$open()
remDr$navigate(url)
details <- remDr$findElement(using = "xpath", paste("(//div[@class='username mo'])"))
remDr$mouseMoveToLocation(webElement=details)
How can I get a memberid ? See image.
library(rvest)
h<-read_html(url)
id<-html_attr(html_node(h,".expand_inline"),"class")
id is expand_inline scrname mbrName_9520BF5DXXXXXid2<-gsub("expand_inline scrname mbrName_","",id)
id2 is 9520BF5DXXXXXindurl<-paste0("https://www.tripadvisor.co.kr/MemberProfile-a_uid.",id2)
indinfo<-read_html(indurl)
name<-html_text(html_node(indinfo,".nameText"));name