Hey guys, Im trying to do some data mining and analyze data based on locations. For this site, http://www.dianping.com/shop/1898365 I am trying to figure out whats the latitude and longitude by crawling. But I cant seem to figure out where this information is stored. Can someone give me some pointers
A:
Need a little more info here. What are you looking for? Elements in the page that were clicked? Or an element given by an id, name or class?
You can get the position of any element on a page by its offsetLeft and offsetTop by doing something like this:
var x =document.getElementById('myId').offsetLeft;
var y =document.getElementById('myId').offsetTop;
See this page:
http://www.quirksmode.org/js/findpos.html
or if you are using jquery:
var myOffset = $('#myId').offset();
var x = myOffset.left;
var y = myOffset.top;
Dale
2010-06-08 17:21:05
sorry i was talking about the latitude and longitude displayed in the google map marker on the right of the page. I want to figure out the coordinates of the location when I am crawling.
hao
2010-06-08 17:31:17
Sorry about that. I haven't worked with the google maps api for over a year. But as I remember getting the latitude and longitude are very common. Have you been through the API? I'm sure you are quite familiar with it.
Dale
2010-06-08 18:02:12