Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Clipping a remote webpage with Javascript/XPath and including in a "local" webpage

Reply
Thread Tools

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

 
 
soren625
Guest
Posts: n/a
 
      12-12-2006
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

 
Reply With Quote
 
 
 
 
pcx99
Guest
Posts: n/a
 
      12-12-2006
soren625 wrote:
> 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.

---------------------------------------------------------------------------
http://www.hunlock.com
$FA
 
Reply With Quote
 
 
 
 
soren625
Guest
Posts: n/a
 
      12-12-2006
On Dec 12, 8:49 am, pcx99 <x...@x.com> wrote:

......

> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
css border clipping differently in ff and ie eggsurplus HTML 3 04-26-2007 08:28 PM
Histogram and highlight clipping in DSLR's Mueen Nawaz Digital Photography 9 12-22-2006 10:17 PM
Clipping a pic and saving it in a file in DOT NET Dixon ASP .Net 4 01-30-2006 03:11 PM
Tkinter, resizing, and widget clipping Douglas Alan Python 1 11-08-2003 07:01 AM
mp3 and sound clipping? Ransom B. Nichols Computer Support 2 07-23-2003 10:45 PM



Advertisments