I have a script that will grap a url from the database, download the html page with wget, and I have script that will parse the page for content. This works, only because I've tested it with a 'known' url, and thus the name of the downloaded file is index.php.
When this goes live, the name of the downloaded file will vary (ie index.html, index.php, pro.asp etc etc). Given that some of the urls will be ...index.php?name=something&file=whatsit, how can I extract the name of the downloaded file for parsing?