Getting real url from ASP database.

Discussion in 'Perl Misc' started by Rich @ Ultima Thule, Nov 12, 2003.

  1. I have a number of links within a database which link to asp pages with a
    clickthru which opens a browser with the real URL in. e.g.
    www.somesite.com/asp/clickthru.asp?id=180 and this goes to www.realsite.com.

    Is it possible in perl to simulate a browser visiting the asp page and
    recover the real URL?

    Apologies if this has been asked before but I have done a google groups
    search to no avail.

    Thanks for any assistance

    Richard Lee.
     
    Rich @ Ultima Thule, Nov 12, 2003
    #1
    1. Advertising

  2. Rich @ Ultima Thule wrote:
    > I have a number of links within a database which link to asp pages
    > with a clickthru which opens a browser with the real URL in. e.g.
    > www.somesite.com/asp/clickthru.asp?id=180 and this goes to
    > www.realsite.com.
    >
    > Is it possible in perl to simulate a browser visiting the asp page
    > and recover the real URL?


    Not sure what it is you want to do. What do you mean by "recover"?

    By help of a module, you can easily have Perl fetch the source code of
    a URL.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Nov 12, 2003
    #2
    1. Advertising

  3. "Gunnar Hjalmarsson" <> wrote in message
    news:bota4v$1i6km6$-berlin.de...
    > Rich @ Ultima Thule wrote:
    > > I have a number of links within a database which link to asp pages
    > > with a clickthru which opens a browser with the real URL in. e.g.
    > > www.somesite.com/asp/clickthru.asp?id=180 and this goes to
    > > www.realsite.com.
    > >
    > > Is it possible in perl to simulate a browser visiting the asp page
    > > and recover the real URL?

    >
    > Not sure what it is you want to do. What do you mean by "recover"?
    >
    > By help of a module, you can easily have Perl fetch the source code of
    > a URL.
    >
    > --
    > Gunnar Hjalmarsson
    > Email: http://www.gunnar.cc/cgi-bin/contact.pl
    >


    Recover as in get and store in a database....

    I think i have done it in a roundabout way using wget.

    wget
    http://www.someaddress/asp/clickthru.asp?id=180 --server-response --spider -otmp
    && cat tmp |grep following |tail -n 1|awk '{print $2}' && rm -f tmp

    I am just trying to stick that into a script as i type.

    Cheers.
    Rich
     
    Rich @ Ultima Thule, Nov 12, 2003
    #3
  4. Rich @ Ultima Thule wrote:
    > "Gunnar Hjalmarsson" <> wrote in message
    > news:bota4v$1i6km6$-berlin.de...
    >> Rich @ Ultima Thule wrote:
    >>> I have a number of links within a database which link to asp
    >>> pages with a clickthru which opens a browser with the real URL
    >>> in. e.g. www.somesite.com/asp/clickthru.asp?id=180 and this
    >>> goes to www.realsite.com.
    >>>
    >>> Is it possible in perl to simulate a browser visiting the asp
    >>> page and recover the real URL?

    >>
    >> Not sure what it is you want to do. What do you mean by
    >> "recover"?

    >
    > Recover as in get and store in a database....


    Okay. To get it, you may want to use LWP::Simple. If you by database
    mean a relational db, e.g. MySQL, you'd better check out the DBI module.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Nov 12, 2003
    #4
  5. "Gunnar Hjalmarsson" <> wrote in message
    news:botij4$1hc3l0$-berlin.de...
    > Rich @ Ultima Thule wrote:
    > > "Gunnar Hjalmarsson" <> wrote in message
    > > news:bota4v$1i6km6$-berlin.de...
    > >> Rich @ Ultima Thule wrote:
    > >>> I have a number of links within a database which link to asp
    > >>> pages with a clickthru which opens a browser with the real URL
    > >>> in. e.g. www.somesite.com/asp/clickthru.asp?id=180 and this
    > >>> goes to www.realsite.com.
    > >>>
    > >>> Is it possible in perl to simulate a browser visiting the asp
    > >>> page and recover the real URL?
    > >>
    > >> Not sure what it is you want to do. What do you mean by
    > >> "recover"?

    > >
    > > Recover as in get and store in a database....

    >
    > Okay. To get it, you may want to use LWP::Simple. If you by database
    > mean a relational db, e.g. MySQL, you'd better check out the DBI module.
    >


    Thanks, i will try that, it looks like a more elegant solution than mine
    using the shell commands. I am not really a perl programmer (.NET is more my
    bag) and this is just a favour which is turning out to be more of a faf than
    i first though.

    Richard.
     
    Rich @ Ultima Thule, Nov 12, 2003
    #5
    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. senthil
    Replies:
    5
    Views:
    1,443
    senthil
    Jan 24, 2004
  2. Nobody

    Getting the real requested URL

    Nobody, Feb 3, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    4,850
    Patrice Scribe
    Feb 5, 2004
  3. Jon paugh
    Replies:
    1
    Views:
    956
  4. anonymous
    Replies:
    1
    Views:
    4,663
    Francisco Padron
    May 8, 2005
  5. Curious Trigger
    Replies:
    2
    Views:
    1,854
    Curious Trigger
    Sep 9, 2006
Loading...

Share This Page