How do I capture coordinates from Google Map

Questions and answers about anything related to Helium Scraper
Post Reply
zeeshans
Posts: 7
Joined: Sun Jun 05, 2011 9:03 am

How do I capture coordinates from Google Map

Post by zeeshans » Thu Jul 28, 2011 1:25 pm

Hey Admin,

I need your help urgently. I am preparing a list of companies and one information which I need to capture is their location coordinates as given by Google Maps. When in the browser, I can select the coordinates but using the select option of the helium scraper I am unable to select this information. Please help urgently. Here is the link to the website and steps to go to the required page:

http://www.uaeexportdirectory.com/en/Industrial.aspx

Steps:
Press any letter from the alphabet list corresponding to the name of specific factory in order to find the goods produced by that factory.
On the next page Click 'List of Companies'
On the next page Click 'Details' to open the details of that company
Click on the 'Map' tab to get to that company's google map and below the image you'll find coordinates which are to be captured. In some cases, the coordinates will not appear and will only give ' N: E:' but that is fine, I need to capture whatever is available.

Please help!

Thanks!

Regards,
Zeeshan

webmaster
Site Admin
Posts: 521
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Re: How do I capture coordinates from Google Map

Post by webmaster » Thu Jul 28, 2011 7:14 pm

Hi Zeeshan,

The attached project should get you started. It has two JavaScript gatherers called JS_North and JS_East. You can look at their code from the Project -> JavaScript Gatherers menu item in case you are curious.

Anyway, given a kind that selects the map (which is an IFRAME element, and this is why you can't select the text inside), they will give you the N and E coordinates. I already created a kind called Map that selects the map, so to extract the coordinates you would just need to create an Extract action that extracts from the Map kind the JS_North and JS_East properties.

You can also test them by selecting the map and looking at the selection panel below the browser.
Attachments
Coordinates.hsp
(279.17 KiB) Downloaded 699 times
Juan Soldi
The Helium Scraper Team

zeeshans
Posts: 7
Joined: Sun Jun 05, 2011 9:03 am

Re: How do I capture coordinates from Google Map

Post by zeeshans » Thu Jul 28, 2011 10:44 pm

Hi Juan,

Thanks a lot!!! it was a great help!

Regards,
Zeeshan

zeeshans
Posts: 7
Joined: Sun Jun 05, 2011 9:03 am

Re: How do I capture coordinates from Google Map

Post by zeeshans » Thu Jul 28, 2011 11:34 pm

Hi Juan,

I know its stupid but I can see the coordinates in the selection below but when I create an Extract Action to extract JS_East or JS_North properties from the kind Map, it shows me empty fields although I have selected JS_East in the Map property. I would be really grateful if you could just create a sample action where these coordinates are being stored in Table as well.

Thanks and awaiting reply!

Regards,
Zeeshan

webmaster
Site Admin
Posts: 521
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Re: How do I capture coordinates from Google Map

Post by webmaster » Fri Jul 29, 2011 3:01 am

I don't think you are doing anything wrong. You most likely didn't refresh the table or tried to extract from a page where there is no map, or with a map with no coordinates. Try setting a requirement of exactly 1 item on your Extract action.

Anyway, here is a sample project that extracts the coordinates. Remember that you'll need to navigate to where the map is before, and make sure the map has the coordinates underneath. When creating your project you'll most likely need to use a Navigate action that simulates click on the "Map" button so that the map shows up.
Attachments
CoordinatesSample.hsp
(291.79 KiB) Downloaded 689 times
Juan Soldi
The Helium Scraper Team

zeeshans
Posts: 7
Joined: Sun Jun 05, 2011 9:03 am

Re: How do I capture coordinates from Google Map

Post by zeeshans » Fri Jul 29, 2011 11:55 pm

Hi Juan,

Thanks for the usual help. I figured out that there was no problem with the JS Gatherers. The real problem is that I was and am still unable to make the "Map" tab click. May be its in the tab format so I am unable to select it through Navigate. I created a kind called MapLink which selects Map tab when I check it from kinds but when I use it in the action, it does not click the tab.

What is it that I could be doing wrong? Is there a special way to deal with tabs?

Regards,
Zeeshan

webmaster
Site Admin
Posts: 521
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Re: How do I capture coordinates from Google Map

Post by webmaster » Sun Jul 31, 2011 3:38 am

Hi,

Try turning on the "Simulate click" option on your Navigate action. If the map loads dinamically you might need to either add a Wait action or import the "Force Select" premade (just click the More... item in the Execute Actions Tree action for more info regarding this premade).
Juan Soldi
The Helium Scraper Team

zeeshans
Posts: 7
Joined: Sun Jun 05, 2011 9:03 am

Re: How do I capture coordinates from Google Map

Post by zeeshans » Sun Jul 31, 2011 7:56 am

Hi Juan,

I have tried putting wait command, I have tried importing the force action but it just does not select the required tab (Map). I really dont know what else to try :( Here is the relevant source code which I think might be useful for you to guide me how should i click this tab because unless its clicked, it will not load the google map and I will not be able to extract coordinates. I know I am bugging you a lot but your help will be greatly appreciated. I really need to capture this information.

Here's the source code of the page which might be useful

<div id="tabs">

<ul><li><a href="#tabs_two-1">Full Directory Listing</a></li><li><a href="#tabs_two-2">Map</a></li><li><a href="#tabs_two-3">Details</a></li><li><a href="#tabs_two-4">Contact Information</a></li><li><a href="#tabs_two-5">Products & Services</a></li></ul>

<div id="tabs_two-1">

<!-- company ad-->

<div id="ad">



</div>

<!-- end company ad-->

</div>

<div id="tabs_two-2">
<!-- Google Map -->
<iframe scrolling="no" width="690" height="390" frameborder="0" marginheight="0" marginwidth="0" src="MapCompany.aspx?Id=7937"></iframe>
<!-- end Google Map -->
</div>

Awaiting reply

Regards,
Zeeshan

webmaster
Site Admin
Posts: 521
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Re: How do I capture coordinates from Google Map

Post by webmaster » Sun Jul 31, 2011 6:28 pm

Hi,

Here is a sample project that clicks the map tab and then extracts the coordinates. It didn't really need a wait or force select action or anything other than checking the "Simulate Click" option. I wonder if the problem you are having if somewhere else. If so, feel free to attach your project here so I can take a look at it.

Do you mean that the tab is not selected but just the "Map" text inside? This is fine since you can use that text as your "Map" button (such as in the attached project).
Attachments
Map.hsp
(302.43 KiB) Downloaded 701 times
Juan Soldi
The Helium Scraper Team

Post Reply