url = 'http://www.test.com/TEST1' l = url.split('/', -1)[-1]
Here is what the above code is Doing:
1. It’s splitting the URL into a list of strings, using ‘/’ as the separator.
2. It’s taking the last element of the list, which is the last part of the URL.