def get_domain_url(url):
if "<STR_LIT>" not in url and "<STR_LIT>" not in url:<EOL><INDENT>return url<EOL><DEDENT>url_header = url.split('<STR_LIT>')[<NUM_LIT:0>]<EOL>simple_url = url.split('<STR_LIT>')[<NUM_LIT:1>]<EOL>base_url = simple_url.split('<STR_LIT:/>')[<NUM_LIT:0>]<EOL>domain_url = url_header + '<STR_LIT>' + base_url<EOL>return domain_url<EOL>
Use this to convert a url like this:
https://blog.xkcd.com/2014/07/22/what-if-book-tour/
Into this:
https://blog.xkcd.com