Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Getting real url from ASP database.

Reply
Thread Tools

Getting real url from ASP database.

 
 
Rich @ Ultima Thule
Guest
Posts: n/a
 
      11-12-2003
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.


 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      11-12-2003
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

 
Reply With Quote
 
 
 
 
Rich @ Ultima Thule
Guest
Posts: n/a
 
      11-12-2003

"Gunnar Hjalmarsson" <(E-Mail Removed)> wrote in message
news:bota4v$1i6km6$(E-Mail Removed)-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


 
Reply With Quote
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      11-12-2003
Rich @ Ultima Thule wrote:
> "Gunnar Hjalmarsson" <(E-Mail Removed)> wrote in message
> news:bota4v$1i6km6$(E-Mail Removed)-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

 
Reply With Quote
 
Rich @ Ultima Thule
Guest
Posts: n/a
 
      11-12-2003

"Gunnar Hjalmarsson" <(E-Mail Removed)> wrote in message
news:botij4$1hc3l0$(E-Mail Removed)-berlin.de...
> Rich @ Ultima Thule wrote:
> > "Gunnar Hjalmarsson" <(E-Mail Removed)> wrote in message
> > news:bota4v$1i6km6$(E-Mail Removed)-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.


 
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
Getting final url when original url redirects IanR Python 2 03-12-2009 08:50 PM
getting values from URL such as http://groups.google.co.uk/groups?q=parameters+url+asp.net&start=10&hl=en&lr=& anonymous ASP .Net 1 05-08-2005 03:58 PM
URL - substitution of a correct URL by a GUID like URL in favorites. Just D. ASP .Net Mobile 0 08-11-2004 04:26 PM
redirect URL's, return URL's, and URL Parameters Jon paugh ASP .Net 1 07-10-2004 05:29 AM
Getting the real requested URL Nobody ASP .Net 2 02-05-2004 11:17 AM



Advertisments