Laravel.io
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Requests;
use RedBeanPHP\R;
use PhpQuery\PhpQuery as phpQuery;
use GuzzleHttp\Client;
use Cache;

class GoogleShoppingController extends Controller {

    private $html;
    private $urls;

    private function getHtml($url) {
        $request = new Client();
        try {
            // see if url/html exists in Cache
            // if it does not, fetch the html and store it in the cache
            if (Cache::has($url)) {
                $this->html = Cache::get($url);
            } else {
                $response = $request->get($url);
                Cache::put($url, $response->getBody(), 3600);                
            }
        } catch (RequestException $e) {
            echo $e->getRequest();
            if ($e->hasResponse()) {
                echo $e->getResponse();
            }
        }

        $this->html = Cache::get($url);
        $this->loadHtmlDom();
    }

    private function loadHtmlDom() {
        phpQuery::newDocumentHTML($this->html);
    }

    private function getLinks($url, $selector) {
        $this->getHtml($url);
        foreach (phpQuery::pq($selector) as $link) {
            $links[] = phpQuery::pq($link)->attr("href");
        }
        return $links;
    }

    public function getGoogleShoppingSearchResults() {
        $this->urls = $this->getLinks("https://www.google.com/search?q=mattress&hl=en&tbm=shop", ".r a");
        return $this->urls;
    }

    public function parseGoogleShoppingProductLinks() {
        foreach ($this->urls as $url) {
            $parsed = parse_url($url);

            if (isset($parsed['path']) && strpos($parsed['path'], 'shopping/product/')) {
                $parsed['host'] = 'www.google.com';
                unset($parsed['query']);

                $urls[] = "http://" . $parsed['host'] . $parsed['path'];
                return $urls;
            }
        }
    }

    public function parseGoogleSponsoredProductLinks() {
        foreach ($this->urls as $url) {
            $parsed = parse_url($url);

            if (isset($parsed['path']) && $parsed['path'] == '/aclk') {
                $parsed_query = parse_str($parsed['query'], $query);
                $parsed_adurl = parse_str($query['adurl'], $adurl);

                if (isset($adurl['ds_dest_url'])) {
                    $urls[] = $adurl['ds_dest_url'];
                } else if ($adurl['u']) {
                    $urls[] = $adurl['u'];
                }
                return $urls;
            }
        }
    }

Please note that all pasted data is publicly available.