input: Write a python function to extract categories from a URL.
  assert extract_category_from_url("http://example.com/category1/category2") == ['example.com', 'category1', 'category2']
  assert extract_category_from_url("https://shop.example.com/products/category") == ['shop.example.com', 'products', 'category']
  assert extract_category_from_url("http://example.com") == ['example.com']
output: def extract_category_from_url(url):
      from urllib.parse import urlparse
      parsed_url = urlparse(url)
      netloc = parsed_url.netloc
      path = parsed_url.path.strip('/').split('/')
      if path == ['']:
          path = []
      return [netloc] + path