params = dict(
title='Title',
geometry='300x250',
)
def apply_params(root, params):
for func, value in params.items():
getattr(root, func)(value)
<?php
$url = "https://www.okeydostavka.ru/webapp/wcs/stores/servlet/ProductListingView?lm=&ajaxStoreImageDir=%2Fwcsstore%2FOKMarketSAS%2F&searchType=1000&advancedSearch=&filterTerm=&storeId=10653&manufacturer=&ddkey=ProductListingView_6_-1011_3074457345618259713&sType=SimpleSearch&metaData=&catalogId=12052&searchTerm=&resultsPerPage=72&filterFacet=&resultCatEntryType=&gridPosition=&emsName=&disableProductCompare=true&langId=-20&facet=&categoryId=16556&custom_view=true";
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$headers = array(
"Connection: keep-alive",
"DNT: 1",
"Content-Type: application/x-www-form-urlencoded",
"X-Requested-With: XMLHttpRequest",
"sec-ch-ua-mobile: ?0",
"User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36",
"Accept: */*",
"Origin: https://www.okeydostavka.ru",
"Sec-Fetch-Site: same-origin",
"Sec-Fetch-Mode: cors",
"Sec-Fetch-Dest: empty",
"Referer: https://www.okeydostavka.ru/spb/miaso-ptitsa-kolbasy/sosiski-sardel-ki",
"Accept-Language: en-US,en;q=0.9,ru-RU;q=0.8,ru;q=0.7"
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$data = "contentBeginIndex=0&productBeginIndex=72&beginIndex=72&orderBy=&facetId=&pageView=grid&resultType=products&orderByContent=&searchTerm=&facet=&facetLimit=&minPrice=&maxPrice=&pageSize=&storeId=10653&catalogId=12052&langId=-20&scrollTo=0&objectId=_6_-1011_3074457345618259713&requesttype=ajax";
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$resp = curl_exec($curl);
curl_close($curl);
var_dump($resp);
?>