Nimex
Nimex

Reputation: 33

Using import.io with mouseover text

Long time viewer, first time poster!

I am having some trouble... I notice that apparently scraping mouseover text is an option when crawling webpages now (http://support.import.io/forums/199278-ideas-forum/suggestions/10368834-website-elements-displayed-on-mouseover), but I cannot figure out how to do this!

The type of page I am trying to do this on is this (which I will use for crawling on many similar pages): https://www.kickstarter.com/profile/1874304670 I am wanting the numbers in each section of the circle graph, along with the titles of those categories in the graph. This text only appears on mouseover. I cannot get this text to display when making my crawler, much less have the data scraped.

Alternatively, I could get the information if I could use the page source to extract the data, since the data is there before other code changes it into the graph. BUT, it seems that this functionality is not yet available with the crawler, only the extractor (from the best I can tell).

Any help on how to do this directly? Or maybe with some sort of workaround? Perhaps import.io isn't what I should be using for this, but it would be great if I could!

Thanks in advance!

Upvotes: 3

Views: 141

Answers (1)

Bam4d
Bam4d

Reputation: 610

There's no "out of the box" way to do this in import.io, there is a workaround if you know a bit about JS however...

if you use a custom xpath .//*[@id='small_circle'] you can get to a piece of json data that contains the information you want.

it's in this format:

[...{
"category_id":26,
"label":"Crafts",
"projects_backed":0,
"color":"rgba(0,0,0,0.0)",
"path":"/profile/1874304670?category_id=26&ref=wheel",
"data":1
}, 
...
]

You could do some post-processing after the crawling to filter out the relevant parts you wanted, or parse it with JS and just take the "label" and "projects_backed" keys.

Upvotes: 3

Related Questions