Getting real url from ASP database.

  • Thread starter Rich @ Ultima Thule
  • Start date
R

Rich @ Ultima Thule

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.
 
G

Gunnar Hjalmarsson

Rich said:
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.
 
R

Rich @ Ultima Thule

Gunnar Hjalmarsson said:
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.

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
 
G

Gunnar Hjalmarsson

Rich said:
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.
 
R

Rich @ Ultima Thule

Gunnar Hjalmarsson said:
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.
 

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,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top