Get Google Maps marker coordinates

I am creating a database containing the names and coordinates of all the stops in my local area. I have all the names stored in my database, and now I need to add the coordinates. I am trying to get them on a website that contains them as tags on a Google map. It seems to me that they are generated from the local server, and then added to the map. However, I cannot pinpoint where the server is being requested for coordinates.

I hope to collect these coordinates using a screen scraper. However, if I cannot find where the coordinates are created in the source code, this seems impossible. I can, of course, search and collect all these tags manually, but it will take a lot of time. So I hope someone here can help me.

This is the website I'm trying to clean. Labels are marked with a blue tire sign:

http://reiseplanlegger.skyss.no/scripts/travelmagic/TravelMagicWE.dll/?from=Brimnes+ferjekai+%28Eidfjord%29&to=

You can also get the coordinates of one label by writing the name of the stop in the search field and clicking the "Vis i kart" button.

Hope someone can help me.

+3
source share
2 answers

When checking with Firebug, it seems that the site you mentioned receives XML data using simple AJAX requests, such as:

http://reiseplanlegger.skyss.no/scripts/travelmagic/TravelMagicWE.dll/mapxml?x1=4.85321044921875&x2=5.8282470703125&y1=60.150391714056326&y2=60.524184817591276&loc=1

(x1, y1), (x2, y2) (, ) . , , AJAX, .

AJAX:

<stages>
  <i n="Arna Stasjon Togstopp (Bergen)" sn="" v="12019888" t="2" i="0" x="5,465809" y="60,420116" sp="" st="Tog.GIF"/>
  <i n="Arna Terminal (Bergen)" sn="" v="12014200" t="2" i="0" x="5,464333" y="60,420319" sp="" st="Buss.GIF"/>
  <i n="Bjørkheim Ved Senter (Samnanger)" sn="" v="12426607" t="2" i="0" x="5,730484" y="60,402178" sp="" st="Buss.GIF"/>
  <i n="Bjørkheim Ved Senter (Samnanger)" sn="" v="12426608" t="2" i="0" x="5,731842" y="60,401312" sp="" st="Buss.GIF"/>
  <i n="Breistein Ferjekai (Bergen)" sn="" v="12017399" t="2" i="0" x="5,399175" y="60,490519" sp="" st="Ferge.GIF"/>
  <i n="Eikelandsosen Terminal (Fusa)" sn="" v="12410510" t="2" i="0" x="5,747773" y="60,241479" sp="" st="Buss.GIF"/>
</stages>

, x , y .


, .

+4

. Google Google. . , JS. Ajax. , .

+1

Source: https://habr.com/ru/post/1737158/


All Articles