Nov 3, 2007

Let’s say you had a wealth of information in a Google spreadsheet that you wanted to access using Javascript. And let’s say you also forgot you could export the doc as a .csv file (or in my case, wanted to try your hand at javascript screen scraping). What’s a super-simple way you could accomplish this?

Glad you asked, because I’ve got just the solution for you. It requires using Prototype, though you could use it with just about any other library which lets you use CSS selectors.

First, create an array with which to store your data:

var items = [];

Then, you’ll have want to create a function which takes the raw HTML input and parses it into a set of objects:

function parseData(googleDoc) {
var divItem = document.createElement('div');
divItem.inne...

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help