I want to parse product data from this page, but with requests.get it is not work. So I inspected page networks and found intereste link:

enter image description here

I tried to send post request to this link with correct form data, but in response i got only {"message":"Expecting value (near 1:1)","status":400}

How can I get correct product data from this page?

It looks like your post is mostly code; please add some more details.

It looks like your post is mostly code; please add some more details.

import requests

headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36",
    "Accept": '*/*',
    "Accept-Encoding": "gzip, deflate, br",
    'Connection': 'keep-alive',
    'Host': 'cgrd9wlxe4-dsn.algolia.net',
    'Origin': 'https://www.eprice.it',
    'Referer': "https://www.eprice.it/",
    'Content-Type': 'application/x-www-form-urlencoded',
    "Sec-Fetch-Dest": 'empty',
    "Sec-Fetch-Mode": 'cors',
    'Sec-Fetch-Site': 'cross-site',
    'sec-ch-ua': "Not A;Brand",
    "sec-ch-ua-mobile": '?0',
    "sec-ch-ua-platform": "Windows",
}
form_data = {
    "requests": [
        {
            "indexName": "prd_products_suggest",
            "params": {
                "highlightPreTag": "<strong>",
                "highlightPostTag": "</strong>",
                "query": 6970995781939,
                "hitsPerPage": 36,
                "clickAnalytics": 1,
                "analyticsTags": ["main", "desktop"],
                "ruleContexts": ["ovr", "desktop", "t1"],
                "facetingAfterDistinct": 1,
                "getRankingInfo": 1,
                "page": 0,
                "maxValuesPerFacet": 10,
                "facets": ["manufacturer", "offer.price", "scegliPer", "offer.shopType",
                           "reviews.avgRatingInt",
                           "navigation.lvl0,navigation.lvl1,navigation.lvl2,navigation.lvl3"],
                "tagFilters": ""
            }
        },
        {
            "indexName": "prd_products_suggest_b",
            "params": {
                "query": 6970995781939,
                "hitsPerPage": 10,
                "clickAnalytics": 1,
                "analyticsTags": ["car_offerte_oggi", "desktop"],
                "ruleContexts": ["ovr", "car_offerte_oggi", "desktop"],
                "getRankingInfo": 1,
                "page": 0,
                "maxValuesPerFacet": 10,
                "minProximity": 2,
                "facetFilters": [],
                "facets": ["manufacturer", "offer.price", "scegliPer", "offer.shopType", "reviews.avgRatingInt",
                           "navigation.lvl0,navigation.lvl1,navigation.lvl2,navigation.lvl3"],
                "tagFilters": ""
            }
        }
    ]
}
response = requests.post(
    url="https://cgrd9wlxe4-dsn.algolia.net/1/indexes/*/queries?"
        "x-algolia-agent=Algolia%20for%20JavaScript%20(4.11.0)%3B%20Browser%20(lite)&"
        "x-algolia-api-key=e9c9895532cb88b620f96f3e6617c00f&"
        "x-algolia-application-id=CGRD9WLXE4",
    headers=headers,
    data=form_data
)
print(response.text)
🔴 No definitive solution yet
📌 Solution 1
0

Try to use parameter json instead of data

 json=form_data