开发者

Bookmarklet for ScreenScaping

开发者 https://www.devze.com 2022-12-17 18:50 出处:网络
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 Greasem

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开发者_如何学Go 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消