Embed Object Width and Height Properties

Questions and answers about anything related to Helium Scraper
Post Reply
Jake
Posts: 3
Joined: Sun Mar 18, 2012 9:26 pm

Embed Object Width and Height Properties

Post by Jake » Sun Mar 18, 2012 9:30 pm

Hello,

I'm probably missing something, but what I'd like to do when scraping is extract the height and width of an embed object. I can get the object itself to download, but don't see how to extract those attributes.

For example

Code: Select all

<embed src="http://whatever" width="720" height="480">
I'd like to extract and store the width and height attributes. Can I do this?

Thanks in advance!

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

Re: Embed Object Width and Height Properties

Post by webmaster » Mon Mar 19, 2012 4:50 pm

I believe there is already a property called Width or JS_Width, but if not try creating a JavaScript Gatherer with this code:

Code: Select all

return element.getAttribute('width');
And then use this gatherer in your Extract action under the Property column with a kind that selects the embed element.
Juan Soldi
The Helium Scraper Team

Jake
Posts: 3
Joined: Sun Mar 18, 2012 9:26 pm

Re: Embed Object Width and Height Properties

Post by Jake » Tue Mar 20, 2012 10:58 am

Thank you, this works perfectly!

Post Reply