By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,364 Members | 1,341 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,364 IT Pros & Developers. It's quick & easy.

retrieving HTML text

P: n/a
Hi All.

Is there a way in Javascript to retrieve the HTML text from a webpage,
without actually opening the web page? For example, specify a web page
(it's actually the reply to an HTTP GET), and load the HTML from the
page into a string variable.

I want to parse out certain data from the source page, and display it on
another web page. I've done this in VB, but am new to Java.

Thanks for any ideas.

Don

*** Sent via Developersdex http://www.developersdex.com ***
Nov 6 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Don S wrote:
Is there a way in Javascript to retrieve the HTML text from a webpage,
without actually opening the web page? For example, specify a web page
(it's actually the reply to an HTTP GET), and load the HTML from the
page into a string variable.

I want to parse out certain data from the source page, and display it on
another web page.
Client-side: If the source is on the same domain, use a hidden (i)frame or
XMLHttpRequest as-is; if not, get authorization from their authors and use
server-side URL rewrite or a proxy script to fool the DOM into believing it
is from the same domain.

Or you can do this server-side only with no but legal boundaries.

If you don't have authorization to use that foreign content in your site, in
any case don't do it, ever; you would violate copyright/author's rights and
could be forced by the author's lawyer to pay a considerable fee for
avoiding to go to court which would cost you or your customer even more.
I have seen that before.
I've done this in VB, but am new to Java.
Since you are from VB: Java <JavaScript
*** Sent via Developersdex http://www.developersdex.com ***
You should not use this buggy Web interface; get yourself a proper
newsreader and newsserver account instead.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Nov 6 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.