title: How can I split a url string up into separate parts in Python?
body: <p>I decided that I'll learn python tonight :)
  I know C pretty well (wrote an OS in it) so I'm not a noob in programming so everything in python seems pretty easy, but I don't know how to solve this problem :
  let's say I have this address:</p>
  
  <p><a href="http://example.com/random/folder/path.html" rel="noreferrer">http://example.com/random/folder/path.html</a> 
  Now how can I create two strings from this, one containing the "base" name of the server, so in this example it would be
  <a href="http://example.com/" rel="noreferrer">http://example.com/</a> 
  and another containing the thing without the last filename, so in this example it would be
  <a href="http://example.com/random/folder/" rel="noreferrer">http://example.com/random/folder/</a> 
  .
  Also I of course know the possibility to just find the 3rd and last slash respectively but maybe you know a better way :]
  Also it would be cool to have the trailing slash in both cases but I don't care since it can be added easily.
  So anyone has a good, fast, effective solution for this? Or is there only "my" solution, finding the slashes?</p>
  
  <p>Thanks!</p>