Get coords of Real Estate

adham

New Member
my task is to download as many flat sell offers as I can. I have script for downloading links and other stuff, but I can't get coordinates of flats (it crucial to me, main point of my analysis).Coordinates are visible on the website (by checking google map element) but not in the source of the website. When I use below R Code I get an empty list, no difference if i use XML or RCurl package. Do you think it is possible to achieve this using R or should I thing about other programming languages (eg. Python?)\[code\]library(XML)library(RCurl)url<-'http://en.otodom.pl/flat-poznan-jezyce-2720m2-2-rooms-125000-pln-id13250586.html'doc<-htmlParse(url,encoding='utf-8')xpathApply(doc,'//div[@id="googleMap"]',xmlGetAttr,'data-map')#the same resultdoc<-getURL(url, httpheader = c('User-Agent' = "Informative string with your contact info"),.encoding='utf-8')doc<-htmlParse(doc,encoding='utf-8')xpathApply(doc,'//div[@id="googleMap"]',xmlGetAttr,'data-map')# the same heredoc<-getURL(url, followlocation=T)doc<-htmlParse(doc,encoding='utf-8')xpathApply(doc,'//div[@id="googleMap"]',xmlGetAttr,'data-map')\[/code\]
 
Back
Top