Google charts

Questions and answers about anything related to Helium Scraper
Post Reply
helium08
Posts: 4
Joined: Mon Oct 07, 2013 7:56 am

Google charts

Post by helium08 » Mon Oct 07, 2013 8:39 am

Hi!

I'm trying to find if there's a way to obtain information from the "tooltip area" in a Google line chart: https://google-developers.appspot.com/c ... /linechart

There are 2 problems I stumbled upon:
1. In "selection mode", I cannot activate the "tooltip area" on hovering over the charts' points (if I activate it before entering the "selection" mode, the area is no longer visible)
2. In my particular case, the "tooltip area" is also a little bit further than the point, so in browser, when you are taking your mouse from the point in the chart, that area instantly disappears
=> I cannot select the desired "kind".

I can see in the source code of the pages from where I want to extract data the elements that I need (the code is a little bit modified/simplified):

Code: Select all

<script type="text/javascript">google.load("visualization", "1", { packages: ["corechart"] });google.setOnLoadCallback(drawChart);function drawChart() {var data = google.visualization.arrayToDataTable([['x', 'Data1', 'Data2'],['2009',354729,10953],['2010',520073,65617],['2011',501803,53395],['2012',112363,44326]]);var chart = new google.visualization.LineChart(document.getElementById('chart_div'));chart.draw(data, {vAxis: {gridlines:{count: 9},title: 'Title1'},fontSize:10, backgroundColor: 'FFFFFF', chartArea: { left: 75, top: 30, width: 350, height: 200} focusTarget: 'category', title: '', curveType: 'function', width: 600, height: 275});}</script>
I only need the two elements (Data1, Data2) - some financial info actually - only from 2011 and 2012.

A closely resembled line chart you can find in Google Analytics, where the analogous needed data will be the visitor numbers in specific days, extracted from the chart.

Is this doable with Helium Scraper and how?

Thank you very much!

crookedleaf
Posts: 38
Joined: Tue Dec 11, 2012 6:44 pm

Re: Google charts

Post by crookedleaf » Mon Oct 07, 2013 5:12 pm

helium08 wrote:Hi!

I'm trying to find if there's a way to obtain information from the "tooltip area" in a Google line chart: https://google-developers.appspot.com/c ... /linechart

There are 2 problems I stumbled upon:
1. In "selection mode", I cannot activate the "tooltip area" on hovering over the charts' points (if I activate it before entering the "selection" mode, the area is no longer visible)
2. In my particular case, the "tooltip area" is also a little bit further than the point, so in browser, when you are taking your mouse from the point in the chart, that area instantly disappears
=> I cannot select the desired "kind".

I can see in the source code of the pages from where I want to extract data the elements that I need (the code is a little bit modified/simplified):

Code: Select all

<script type="text/javascript">google.load("visualization", "1", { packages: ["corechart"] });google.setOnLoadCallback(drawChart);function drawChart() {var data = google.visualization.arrayToDataTable([['x', 'Data1', 'Data2'],['2009',354729,10953],['2010',520073,65617],['2011',501803,53395],['2012',112363,44326]]);var chart = new google.visualization.LineChart(document.getElementById('chart_div'));chart.draw(data, {vAxis: {gridlines:{count: 9},title: 'Title1'},fontSize:10, backgroundColor: 'FFFFFF', chartArea: { left: 75, top: 30, width: 350, height: 200} focusTarget: 'category', title: '', curveType: 'function', width: 600, height: 275});}</script>
I only need the two elements (Data1, Data2) - some financial info actually - only from 2011 and 2012.

A closely resembled line chart you can find in Google Analytics, where the analogous needed data will be the visitor numbers in specific days, extracted from the chart.

Is this doable with Helium Scraper and how?

Thank you very much!

one thing you can try to do is use the keyboard shortcut to enter selection mode. this is particularly helpful with mouseover scripts. when you have moused over an object, press the F4 key on your keyboard to turn on selection mode. this will allow you to select the kind you want.

helium08
Posts: 4
Joined: Mon Oct 07, 2013 7:56 am

Re: Google charts

Post by helium08 » Mon Oct 07, 2013 7:24 pm

Hey! Thanks for the answer!

1. Well, with your tip, I can hover over one point in a classic/default Google line graph, the tooltip appears and then I quickly press F4 and select the desired kind, but the problem is that the text / the tooltip disappears immediately after you mouse the mouse from that point, so the kind won't show anything selected in the end. :(

2. Another problem is that, in my case, the chart is designed in a way in which the tooltip is a little bit far from the point you need to hover on (to see the tooltip/data) and it's impossible to select the data. In the first case, the difference is the way the tooltip is connected with a "quote" line/icon, which permits showing it even after moving the mouse from the initial point.

To better understand case 2, take a look at this kind of chart: https://google-developers.appspot.com/c ... y/geochart - it's different, but the idea is the same: you cannot reach the data in the tooltip with the mouse. :(

crookedleaf
Posts: 38
Joined: Tue Dec 11, 2012 6:44 pm

Re: Google charts

Post by crookedleaf » Tue Oct 08, 2013 4:53 pm

helium08 wrote:Hey! Thanks for the answer!

1. Well, with your tip, I can hover over one point in a classic/default Google line graph, the tooltip appears and then I quickly press F4 and select the desired kind, but the problem is that the text / the tooltip disappears immediately after you mouse the mouse from that point, so the kind won't show anything selected in the end. :(

2. Another problem is that, in my case, the chart is designed in a way in which the tooltip is a little bit far from the point you need to hover on (to see the tooltip/data) and it's impossible to select the data. In the first case, the difference is the way the tooltip is connected with a "quote" line/icon, which permits showing it even after moving the mouse from the initial point.

To better understand case 2, take a look at this kind of chart: https://google-developers.appspot.com/c ... y/geochart - it's different, but the idea is the same: you cannot reach the data in the tooltip with the mouse. :(
hmm. unfortunately, this one is a little beyond me :/ i'm not part of the Helium crew, but have been using it a long time for a ton of different projects, so i try to help people out here. but hopefully Juan will see this thread and give some input. I'm guessing something can be done using the "Execute JS" actions.

helium08
Posts: 4
Joined: Mon Oct 07, 2013 7:56 am

Re: Google charts

Post by helium08 » Fri Oct 11, 2013 12:02 pm

Well, thanks for the answer, crookedleaf. I managed to found the data I needed in another place/website (in simple tables), but it's incomplete. :|

I will eventually manually fill the missing info, so my question still remains. I'm wondering if those Google charts are not used in this case specifically to make the data scraping harder. :roll:

I'm satisfied with Helium Scraper, I managed to successfully run couple of projects myself, with some help from Juan. This is a little bit more complex though (at least for me).

Post Reply