title: How can I download FULL QUALITY pictures from google images using puppeteer?
body: <p>Need help in how to create a stable selector that saves URL in full quality from google images.</p>
  <p>Trying to download 4-25 pictures from google images using puppeteer in full quality.
  It doesn't work.
  The problem is to create a stable selector and getting URLs of the pictures in full quality and not the URL of google's preview mode.</p>
  <p>I had it running already but it broke down due to what I understand to be a not so well selector. Now trying rebuild it.</p>
  <p>Old selector that results in &quot;elements&quot; being undefined:</p>
  <pre><code>let previewimagexpath =
        &quot;/html/body/div[2]/c-wiz/div[3]/div[2]/div[3]/div/div/div[3]/div[2]/c-wiz/div/div[1]/div[1]/div[2]/div/a/img&quot;;
      // previewimagexpath = '//*[@id=&quot;Sva75c&quot;]/div/div/div[3]/div[2]/c-wiz/div/div[1]/div[1]/div[2]/div/a/img'
      for (let i = 1; i &lt; numOfPics; i++) {
        let imagexpath =
          &quot;/html/body/div[2]/c-wiz/div[3]/div[1]/div/div/div/div[1]/div[1]/span/div[1]/div[1]/div[&quot; +
          i +
          &quot;]/a[1]/div[1]/img&quot;;
        const elements = await page.$x(imagexpath);
        await elements[0].click(); 
        await page.waitForTimeout(3000);
        const image = await page.$x(previewimagexpath);
        let d = await image[0].getProperty(&quot;src&quot;);
        //console.log(d._remoteObject.value);
        imagelinkslist.push(d._remoteObject.value);
      }
      await browser.close();
    };
  </code></pre>
  <p>new selector which is resulting in URLs of the preview mode and not in URLs of full quality images.</p>
  <pre><code>axios
    .get(
      &quot;https://www.google.com/search?q=dogs&amp;sxsrf=ALiCzsZW27NYppMFDO9xwabkhmXUQMku8g:1651495383126&amp;source=lnms&amp;tbm=isch&amp;sa=X&amp;ved=2ahUKEwj4-qLd68D3AhUR3KQKHdk3CFYQ_AUoAXoECAIQAw&amp;biw=1680&amp;bih=948&amp;dpr=2&quot;
    )
    .then(response =&gt; {
      const $ = cheerio.load(response.data);
      const image = $(&quot;img&quot;);
      $(&quot;img&quot;).each((i, elem) =&gt; {});
      console.log(image);
    });
  </code></pre>