from typing import List
import requests
from bs4 import BeautifulSoup
import re


def get_keywords(url: str) -> List[str]:
    """
    Returns the keywords of a given url.
        Parameters:
            url (str): a website url
        Returns:
            all_keywords_list (List[str]): list with all keywords as strings.
            If the url does not have keywords a empty list is returned.
    """
    res = requests.get(url, timeout=60.05)
    res.raise_for_status()
    res.encoding = 'utf-8'
    soup = BeautifulSoup(res.text, 'html.parser')
    meta_list = soup.find_all('meta')
    meta_keywords_list = []
    for meta in meta_list:
        meta_name = meta.attrs.get('name', '')
        if re.fullmatch(r'keywords?\b', meta_name):
            meta_keywords_list.append(meta.attrs.get('content'))
 
    all_keywords_list = []
    for meta_keyword in meta_keywords_list:
        keywords_list = meta_keyword.split(',')
        keywords_list = [key.strip() for key in keywords_list if key]
        all_keywords_list.extend(keywords_list)
    return all_keywords_list