Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while($k>1) {
- $html = file_get_contents($url."&page=".$k);
- $document = phpQuery::newDocument($html);
- foreach ($document->find('.a-elem') as $item) {
- $id = pq($item)->attr('data-id');
- $getDetailPage = phpQuery::newDocument(file_get_contents("https://kolesa.kz/a/show/".$id));
- foreach ($getDetailPage->find('.offer__parameters dl') as $prop) {
- $props[] = [
- 'name' => trim(pq($prop)->find('dt')->attr('title')),
- 'value' => trim(pq($prop)->find('dd')->html())
- ];
- }
- /*$data[] = [
- 'id' => $id,
- 'views' => getViewsItem($id),
- 'phone' => getPhones($id),
- 'props' => $props
- ];*/
- $propsNew[] = $props;
- }
- unset($html, $getDetailPage, $props);
- $k--;
- }
- print_r($propsNew);
Advertisement
Add Comment
Please, Sign In to add comment