mardi 31 mai 2016

How does the homepage of shipfinder.com start a request and parse the result?

shipfinder.com provides a function to search information of a ship by its MMSI (or its name, etc.), and the returning messages include ship size, ship location, current speed, and so on. For example, for the ship with MMSI 416003098, some information of ship is presented as follow:

enter image description here

I want to write a crawler program to automatically fetch such information of a specific ship from shipfinder.com.

To this end. Firstly I check the source code of its homepage, and find the search button evokes the function autosearch.queryShip() from AutoSearchShip.js to query the information of a ship. However I can not find which part of javascript actually query the data from the server. Second. with the help of chrome developer tools, I check all requests to the server in the search time of a ship, only seemingly meaningless strings are returned. Take ship (MMSI:416003098) for example, five requests are:

  1. http://ift.tt/25x1BOH
  2. http://ift.tt/1O1V621
  3. http://ift.tt/25x127j
  4. http://ift.tt/1O1V3Do
  5. http://ift.tt/25x1yCv

and their corresponding responses are:

  1. AAABAwkANDE2MDAzMDk4
  2. AAABAAAAAQAAAAEAAAABAAAAAwkANDE2MDAzMDk4GrTLGAAAAAA=
  3. AADgw2lkaRCHsMtuU+Rtx7Bk41x+mcHe2Zn5YI58YM5HRxUxJnnISUbQlNgSSNeaB+tMNAis3M7B3V+RWjutsqfP+GvJ+uXazKQNLZPTJVGTL/SOHF0+mAc+zWEIKd3pyr19dtx0x2xNrg==
  4. AAA5Ho7EMxnUFMtuU+Rtx7Bk41x+mcHe2Zkq2wWscsr4aHNpfYFAKtYTX9+8w0ZS0qxMNAis3M7B3V+RWjutsqfP+GvJ+uXazKQNLZPTJVGTL/SOHF0+mAc+zWEIKd3pyr19dtx0x2xNrg==
  5. AADWgTLOaGbr9dqiyydcW1kQ41x+mcHe2Zk=

I can not make a connection of these strings to the ship information in figure above. I guess some javascript codes may parse some of these string to the specific values.

Please help me find where does the code parse the strings, or provides some relative materials to learn, so I can finish my crawler task.




Aucun commentaire:

Enregistrer un commentaire