PAGE = "https://www.riksdagen.se/sv/webb-tv/video/beslut/teckensprakstolkat-beslut-ja-till-nya-mojligheter_hdc5uulkgixzejmvaqlott/"
import requests
from bs4 import BeautifulSoup
import json

def get_embedded_json(url):
    response = requests.get(url)
    soup = BeautifulSoup(response.content, 'html.parser')
    script_tag = soup.find('script', {"type": 'application/json', "id": "__NEXT_DATA__"})
    if script_tag:
        data = json.loads(script_tag.text)
        return data
    return None
data = get_embedded_json(PAGE)
def get_documentid(data):
    return data.get("props", None).get("pageProps", None).get("contentApiData", None).get("documentId", None)
get_documentid(data)
'HDC5UULKGIXZEJMVAQLOtt'
SEARCH = "https://www.riksdagen.se/sv/sok/?avd=webbtv&lang=sgn"
STS_SEARCH = "https://www.riksdagen.se/sv/sok/?avd=webbtv&lang=sgn&p="
def read_web_search_results(tpl, num_pages=1):
    response = requests.get(tpl + str(num_pages))
    soup = BeautifulSoup(response.content, 'html.parser')
    results = []
    next_link = soup.find('a', {"aria-label": "Nästa sida"})
    has_next = next_link is not None
    sres = soup.find_all('div', class_='flex')
    for res in sres:
        link_tag = res.find('a', {"href": True, "aria-label": True})
        if link_tag:
            if link_tag['href'].startswith('https://'):
                if not link_tag['href'] in results:
                    results.append(link_tag['href'])
    return results, has_next
read_web_search_results(STS_SEARCH, 1)