如何获得APIlink包含python的畅销书徽章?

How to get the API link that contains the bestseller badges by python?

我有一个任务要获取本linkhttps://www.real.de/item/search/?search_value=lattenrost&valueKey_search_value=中的畅销书徽章数据。 我试图在 Web 开发人员工具(XHR 选项卡)中找到 API link,但仍然没有找到它。 你知道我在哪里可以获得 link 或无论如何获取数据吗?

全部built-in进入页面源码。 请参阅脚本标记中的 hm.initialSearchData 变量。


使用正则表达式提取您需要的数据。

import re
import json

resp = your response text

json_text = re.findall('hm.initialSearchData = (.+?)</script>', resp)
data = json.loads(json_text[0])