Automatically create valid links
- by Marcos Placona
Hi, I'm new to python, so please bare with me :)
I was wondering if there's any built-in way in python to append variables to URL's regardless of it's structure.
I would like to have a URL variable (test=1) added to an URL which could have any of the following structures
http://www.aaa.com (would simply add
"/?test=1") to the end
http://www.aaa.com/home (like the one
above, would simply add "/?test=1") to
the end
http://www.aaa.com/?location=home
(would figure out there's already a ?
being used, and would add &test=1 to
the end)
http://www.aaa.com/?location=home&page=1
(like the one above, would figure out
there's already a ? being used, and
would add &test=1 to the end)
I'd be happy to write domething to do it myself, but if python can already do it somehow, I'd me more than happy to use any built-in functionality that would save me some time ;-)
Thanks in advance