views:

57

answers:

1

http://dy-verse.blogspot.com/2009/08/screen-scraping-with-javascript-firebug.html[link text][1]

outlines a strategy to parse a page and submit contents to a Google spreadsheet that depends on Greasemonkey. I'd like to adapt this approach to a simple bookmarklet where, instead of hardcoding in the page address to be parsed, i would manually navigate to the page in question to execute the bookmarklet.

I need help coding the entry point and assigning the elements to be parsed. My page has 3 (un-nested) tables at the top-level of the document - it has no classnames. How do I go about passing those tables into the start() function?

thx

A: 

If you load your page with a bookmarklet you have free hands to use any of your javascript command inside that page.

You can use document.getElementsByTagName('TABLE') or load a JS library that will help you do the job.

And if you are using a modern browser you can use as well the document.querySelectorAll with a CSS selector.

Mic
I forgot to mention a really good example of extensible bookmarklet: quixapp.com
Mic
By 'load your page with a bookmarklet' do you mean one bookmarklet per page to be parsed? In my case, i'd need the bookmarklet to be similar to jQuerify - runs just the javascript against the current page.kinda really sorta need code samples to get where i need to go ... thx again
justSteve
A bookmarklet is a JS injection in the visited page. You need to trigger it manually. Either by typing the code in the address bar, or a link or a bookmark in your browser. Look at how quix explain how to use it.
Mic