How to get everything after last slash in a URL?
One more (idio(ma)tic) way:
URL.split("/")[-1]
rsplit
should be up to the task:
In [1]: 'http://www.test.com/page/TEST2'.rsplit('/', 1)[1]
Out[1]: 'TEST2'
You don't need fancy things, just see the string methods in the standard library and you can easily split your url between 'filename' part and the rest:
url.rsplit('/', 1)
So you can get the part you're interested in simply with:
url.rsplit('/', 1)[-1]