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

r
scraping
webscraping

#1

Hi,

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 <- 'https://www.99acres.com/do/pricetrends?building_id=0&loc_id=12400&prop_type=1&pref=S&bed_no=0&w=600&h=350'

#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')

PriceTrend_data_html

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