Find a way to click "See all photos" on Amazon (pics uploaded by customers)

i want to click on this link on an amazon item page like this one

This does not work for me:

Nor does this (attempt with JavaScript) :

Any suggestions please?

Not my answer, but it worked in my testing—ChatGPT parsed the HTML to this:

const seeAllPhotosLink = document.querySelector('.a-column.a-span6.a-text-right.a-span-last a.a-link-emphasis');

if (seeAllPhotosLink) {
    seeAllPhotosLink.click();
} else {
    console.error('The "See all photos" link was not found.');
}

I don't know if that would ever conflict with something else on the page (it looks pretty generic to me, in terms of identifying info), but it did work.

-rob.

1 Like

Thanks man! How did you write the prompt fror Chat GPT? Did you view source the whole page and paste it into ChatGPT?

I right-clicked on the Show All Photos item and chose Inspect Element, then just copied and pasted the surrounding part to ChatGPT:

<div class="a-column a-span6 a-text-right a-span-last">
  <div data-mix-operations="CRSeeMoreThumbnailOpsClickHandler" data-csa-c-type="widget" data-csa-c-slot-id="cm_cr_dp_see_all_image_carousel_reviews" data-seemore="true" data-asin="B0BRCPS4RF" data-mediatype="IMAGE" data-csa-c-id="sqosm8-bb2nep-toll76-to3d9d">
      <a class="a-link-emphasis" href="javascript:void(0)">See all photos</a>
  </div>
</div>

I need to click on "See all photos" with javscript.

-rob.

1 Like