Page redirect - how to handle?

If you made a script you can offer it to the others here, or ask help to improve it. You can also report here bugs & problems with existing scripts.
Post Reply
LA
Posts: 14
Joined: 2006-08-09 07:08:46
Location: Russia, Moscow

Page redirect - how to handle?

Post by LA »

there is very unusual behaviour of one site, which my script is referring to - when I ask for search (request for page 'http://somesite.com/search.php?s=MovieName'), if more than one movie is found, then everything is OK, but if only one movie is found, than I receive another page with movie details. So,
1) in first case I receive Search results and page 'http://somesite.com/search.php?s=MovieName';
2) in second case I receive Movie Details and another page
'http://somesite.com/movies/123'.
I can detect which page is loaded (by page content), but for further processing I should know URL of loaded page! How can I do it? Could somebody help me pls?
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

There is no function for that currently, but actually the IMDB script has the same "problem".
For that, I searched the movie number somewhere else in the page (in one of the other links to secondary info pages) and rebuild the URL with that (url := 'http://imcdb.com/title/tt' + movienumber)
LA
Posts: 14
Joined: 2006-08-09 07:08:46
Location: Russia, Moscow

Post by LA »

ok.. I have done it in such way... Just expected that there can be more smart way :)

thanks for help & prompt reply!
Post Reply