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

Discussion in 'Javascript' started by soren625, Dec 12, 2006.

  1. soren625

    soren625 Guest

    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
     
    soren625, Dec 12, 2006
    #1
    1. Advertising

  2. soren625

    pcx99 Guest

    Re: Clipping a remote webpage with Javascript/XPath and includingin a "local" webpage

    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
     
    pcx99, Dec 12, 2006
    #2
    1. Advertising

  3. soren625

    soren625 Guest

    On Dec 12, 8:49 am, pcx99 <> 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
     
    soren625, Dec 12, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dixon
    Replies:
    4
    Views:
    565
    Piotr Dobrowolski
    Jan 30, 2006
  2. Douglas Alan

    Tkinter, resizing, and widget clipping

    Douglas Alan, Nov 7, 2003, in forum: Python
    Replies:
    1
    Views:
    417
    Douglas Alan
    Nov 8, 2003
  3. eggsurplus
    Replies:
    3
    Views:
    566
    Neo Geshel
    Apr 26, 2007
  4. Fabian

    Netscape 7 and clipping

    Fabian, Nov 24, 2003, in forum: Javascript
    Replies:
    1
    Views:
    102
    Chaa006
    Feb 25, 2004
  5. Doug van Vianen

    Clipping in Javascript

    Doug van Vianen, Jan 18, 2005, in forum: Javascript
    Replies:
    11
    Views:
    198
    Dr John Stockton
    Jan 22, 2005
Loading...

Share This Page