How to scrape data within a input tag from an iframe using R




I’m trying to scrape the data from a property portal for an academic project. The data I’m interested is Price trends and it’s in a iframe. I want to get the data for upper, average and lower range. This data is stored in a input tag. I’m trying to scrape this data by referring to the class of parent

tag and then to the input tag but can’t get to the data.

There are many iframes which I need to scrape but one of them is this

The code I’ve tried is below but I don’t get desired result. I also tried it using Xpath but that too doesn’t seem to be working.

#Specifying the url of the iframe to be scraped
url <- ''

#Reading the HTML code from the website
download.file(url, destfile = "scrapedpage.html", quiet=TRUE)
webpage <- read_html("scrapedpage.html")

PriceTrend_data_html <- html_nodes(webpage,'.ptplay input')


It would of immense help if someone can guide me here.