import requests
from bs4 import BeautifulSoup


class USDBDownloader:
    def __init__(self, sessid):
        self.sessid = sessid

    def download(self, url: str):
        url = url.replace("detail", "gettxt")
        print(url)

        with requests.Session() as s:
            page = s.post(url, data={'wd': 1}, cookies={'PHPSESSID': self.sessid})

            soup = BeautifulSoup(page.content, 'html.parser')
            txt = soup.find(name="textarea").text
        return txt


if __name__ == '__main__':
    usdbdl = USDBDownloader("")
    usdbdl.download("http://usdb.animux.de/?link=detail&id=16196")