Grabbing site-content using javascript - Grabbing site-content using javascript

They have: 2 posts

Joined: Apr 1999

I'm trying to write a script that would allow me to grab the content off of a site via the source code and store it into a variable.
The content I'm grabbing is text and small in memory size.
I tried the "view-source: url" code but kept getting errors.
Thanks in advance.

They have: 2 posts

Joined: Apr 1999

Well, because I'm trying to get some news articles,(which I've gotten legal consent to do so), and then reformat it into a layout that I specify.
ie. Headline, date, author, body.
I've seen it done, but they haven't returned my requests on how they did it. I don't know if they did it cgi, scripting, or what.

John Pollock's picture

He has: 628 posts

Joined: Mar 1999

I don't think you can pull it straight off the page, but you can pull text from a text box inside a form.

var x=document.form_name.box_name.value;

You might also take a look at:

http://www.wsabstract.com

for some advanced javascript articles.

----------
John Pollock
http://www.pageresource.com

They have: 5,633 posts

Joined: Jan 1970

just to be curious:
why???

They have: 453 posts

Joined: Jan 1999

hi,

i don't think you can grab the content via javascript. js shouldn't be able to connect to any site.

in perl it would be very easy:
I'll post a (very) small demo to the perl/cgi forum.

ciao
anti

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.