I want ask is it possible for me to download the location detail (coordinate and location's name) of a map-based website?

I'm trying to get all the ports name and location from one of these websites




if you open the website you can see there are some ports and I want to get all the name and its coordinate, in .kml format file, if possible.

Do you have any idea how to do this?

1 Answer 1


It looks like the data is stored in an object called jPortData. So what you can do is write some code in the Javascript Console (e.g.: in Chrome).

Run this code:

// Create root geojson FeatureCollection
const root = {
  "type": "FeatureCollection",
  "features": []

// Loop the port data and create a geojson feature for each port
jPortData.forEach((portData) => {
      "type": "Feature",
      "id": portData.id,
      "properties": {
      "geometry": {
        "type": "Point",
        "coordinates": [

// Log the result stringified to the console

So now we have your data as geojson. You could now save the result in a text file and open it in QGIS and convert it to KML. Another option would be to copy the result to geojson.io. There you can also export your data as KML.

Geojson.io Result

You can directly copy the output to your clipboard in Chrome using the copy function.

// Copy to clipboard
  • hi @bloigge and polygeo thank you for you help. you help me save a lot of time. i hope you have a nice day. thank you
    – Josh
    Commented Apr 13, 2022 at 2:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.