I have an url, let's say it is:
website.com/sometext/someothertext/deletetext
How do I delete deletetext
? Then add some other text e.g: 123456
? Preferably using selenium. I'm only trying to delete the text after the 3rd /
I don't want to delete any text before that.
So far I've just got the current url (not including all the other code that doesn't matter here)
current_url = driver.current_url
I found the solution:
current_url = driver.current_url
new_url = current_url.replace("deletetext", "123456")
driver.get(new_url)