Page 1 of 1

Embed Object Width and Height Properties

Posted: Sun Mar 18, 2012 9:30 pm
by Jake
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!

Re: Embed Object Width and Height Properties

Posted: Mon Mar 19, 2012 4:50 pm
by webmaster
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.

Re: Embed Object Width and Height Properties

Posted: Tue Mar 20, 2012 10:58 am
by Jake
Thank you, this works perfectly!