Riju21

12_practice

Mar 27th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. #  http://www.google.com
  2.  
  3. url = 'http://www.tutorialsPoint.expert.com'
  4.  
  5. chunk = url.split('.')
  6. host = chunk.pop()
  7. print('host: '+host)
  8. domaim = []
  9. for i,val in enumerate(chunk):
  10.     if val == 'http' or val == 'www' or val == ':' or val == '//' or val == 'http://www':
  11.        chunk.remove(val)
  12.        domaim = chunk
  13. final = ''
  14. for val in domaim:
  15.     final += val
  16. print('domain: '+final)
Advertisement
Add Comment
Please, Sign In to add comment