I am having a task to get the data of the bestseller badges in this link https://www.real.de/item/search/?search_value=lattenrost&valueKey_search_value= . I tried to find the API link in the Web Developer Tool (XHR tab) however still havent managed to find it yet. Do you know where can i get the link or anyway to get the data ?
Asked
Active
Viewed 44 times
1 Answers
1
It's all built-in into the page source code. See hm.initialSearchData variable in a script tag.
Use regexps to extract data you need.
import re
import json
resp = your response text
json_text = re.findall('hm.initialSearchData = (.+?)</script>', resp)
data = json.loads(json_text[0])

Michael Savchenko
- 1,445
- 1
- 9
- 13