Clipping a remote webpage with Javascript/XPath and including in a "local" webpage

S

soren625

I have searched this (and other) groups extensively, in addition to the
clj FAQ and the Web, and (to my surprise) this question doesn't come up
as often as I thought it would. Maybe this is because either is
patently impossible or I am not searching for the right thing. If
either of these is the case, of course, please let me know.

What I am trying to do is grab a little snippet of data from a remote
page based on user input in a form. Take a look at this page:
http://www.qrz.com/kb2gsd

What I want to do is: when a user types the callsign (in this case,
KB2GSD) into a form field, I want to execute an XPath query via
Javascript to automatically complete the Name, Location, etc from a web
page like the one listed above.

I can compose the requisite XPath query without a problem, and I'm
pretty sure I can create the code to initiate the query, but I'm not
sure how (if it's even possible) to execute such a query on a remote
page. I am somewhat familiar with the document.evaluate() method, but
is there a way to "evaluate" a page other than the one currently
loaded?

Thanks for reading and thanks for a reponse if you're able to help.

PB
 
P

pcx99

soren625 said:
I have searched this (and other) groups extensively, in addition to the
clj FAQ and the Web, and (to my surprise) this question doesn't come up
as often as I thought it would. Maybe this is because either is
patently impossible or I am not searching for the right thing. If
either of these is the case, of course, please let me know.

What I am trying to do is grab a little snippet of data from a remote
page based on user input in a form. Take a look at this page:
http://www.qrz.com/kb2gsd

Is the remote page in the same domain/server as your script page? That
is, the javascript security model will not allow you to contact a third
party site.

If the data is on your own servers then yes you can have javascript
contact the server and request the information. You can do this either
through javascript forms and submits via get and post. Or you can get
fancy and use AJAX to do the lookup without navigating to a new web page.

However, reading your post it appears you wish to extract this
information from a third party site, not under your control. This is
not possible in javascript, it is possible if you have access to
server-side languages like php,perl,etc. Which will direct you to a
different newsgroup.
 
S

soren625

......
However, reading your post it appears you wish to extract this
information from a third party site, not under your control. This is
not possible in javascript, it is possible if you have access to
server-side languages like php,perl,etc. Which will direct you to a
different newsgroup.

That's what I was afraid of ... I know Javascript is *very* security
conscious. You answered my question nonetheless: I'm off to try a
solution using PHP (hopefully) or (if need be) Perl.

Thanks for a quick reply and a concise and helpful answer.

PB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top