# from lxml import etree
#
# with open(r'C:\Users\ASUS\Desktop\text.html','r',encoding='utf-8')as f:
#     resp = f.read()
#
# html = etree.HTML(resp)
# h2_str = html.xpath('//h2[contains(@class,"a-spacing-medium")]/text()')
# print(h2_str)
# data_asin_list = html.xpath(f"//h2[contains(text(),'{h2_str[0]}')]/parent::div/parent::div//@data-asin")
# print(data_asin_list)
import curl_cffi
headers = {
                "Referer": "https://depatisnet.dpma.de/DepatisNet/depatisnet",
                "Origin": "https://depatisnet.dpma.de",
                "Accept": "application/json, text/javascript, */*; q=0.01",
                "Accept-Encoding": "gzip, deflate, br, zstd",
                "Accept-Language": "zh-CN,zh-TW;q=0.9,zh;q=0.8",
                "Cache-Control": "no-cache",
                "User-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36",
            }
resp = curl_cffi.get('https://depatisnet.dpma.de/DepatisNet/depatisnet?window=1&space=main&content=treffer&action=textpdf&docid=CN000119456546B',headers=headers)
print(resp.text)