1

library(xml2)
require(RSelenium)

# open the remote driver
fprof <- makeFirefoxProfile(list(browser.download.dir = "C:/temp"
                                 ,  browser.download.folderList = 2L
                                 , browser.download.manager.showWhenStarting     = FALSE
                                 , browser.helperApps.neverAsk.saveToDisk =  "application/zip"))
remDr <- remoteDriver(browserName = "firefox",remoteServerAddr = "192.168.99.100",port = 4445L,extraCapabilities = fprof)
remDr$open(silent = TRUE)
# 
# go to the webpage
remDr$navigate("https://www.expedia.co.uk/Guangzhou-Hotels-Blog-Hotel-Guangzhou.h8282429.Hotel-Information") 

# create R objects from the website elements
guestreview <- remDr$findElement(using = 'id', value = "tab-reviews")
Nextbtn <- remDr$findElement(using = 'class', value = "pagination-next")


# click the guest review button
remDr$screenshot(display = TRUE)

# get the output
reviews <- remDr$findElement(using = "class", value="translate-text")
reviews <- reviews$getElementText()[[1]] # extract the actual text string

hi, I’m using Rselenium to scrape users reviews from a website expedia. I followed this tutorial https://rawgit.com/petrkeil/Blog/master/2017_08_15_Web_scraping/web_scraping.html but I’m getting an error while trying to click on a button “guest reviews” Can u please help me find my errors I’m stuck on this issue since more than a week

Selenium message:Element is not clickable at point (264, 28.333328247070312). Other element would receive the click: <div class="modal-wrap uitk-tooltip-container modal-dismiss active" id="eds-modal"></div>
  • Possible duplicate of [Selenium Web Driver & Java. Element is not clickable at point (36, 72). Other element would receive the click:](https://stackoverflow.com/questions/44912203/selenium-web-driver-java-element-is-not-clickable-at-point-36-72-other-el) – undetected Selenium Nov 06 '17 at 16:43

2 Answers2

1

fprof <- makeFirefoxProfile(list(browser.download.dir = "C:/temp"
                                 ,  browser.download.folderList = 2L
                                 , browser.download.manager.showWhenStarting     = FALSE
                                 , browser.helperApps.neverAsk.saveToDisk =  "application/zip"))
remDr <- remoteDriver(browserName = "firefox",remoteServerAddr = "192.168.99.100",port = 4445L,extraCapabilities = fprof)
remDr$open(silent = TRUE)
# 
# go to the webpage
remDr$navigate("https://www.expedia.co.uk/Dalian-City-Center-Hotels-Grand-Continent-International-Hotel.h17262978.Hotel-Information") 


#close popup window
remDr$screenshot(display = TRUE)
closebt <- remDr$findElement(using = "id", "modalCloseButton")
closebt$clickElement()
remDr$screenshot(display = TRUE)# just to see if the popup windows is closed

# create R objects from the website elements
guestreview <- remDr$findElement(using = 'id', value = "tab-reviews")
Nextbtn <- remDr$findElement(using = 'class', value = "pagination-next")


# click the guest review button
guestreview$clickElement()

# get the output
out <- remDr$findElement(using = "class", value="translate-text")
out <- out$getElementText()[[1]] # extract the actual text string

emphasized textthis is how i closed the popup

0

When first entering the Expedia website, a pop up appears asking you to enter your check in date.

This pop up is preventing you from performing actions on the page. You must add code to handle this pop up and ultimately close out of it before you can continue.