0

It happens that through puppeteer and dart I'm trying to access this url https://www.walmart.com/ip/seort/688414897?offerId=1C77C470095B4DFAB58D48BB4396DC5A and click on the button with class="bg-transparent bn lh-solid pa0 sans-serif tc underline inline-button black pointer f6". After clicking this button, I should I have access to an lateral overlay layout with an input with class="w_V2kW". But it seems that the click trigger is not having any effect.

Apparently a very straightforward operation on puppeteer, however I tried everything, giving long timeouts, using focus(), etc...last thing I tried was:

          selector = 'button[aria-label*=", "][class="bg-transparent bn lh-solid pa0 sans-serif tc underline inline-button black pointer f6"]';

          await myPage.click(selector);
          await myPage.waitForTimeout(6000);

          await myPage.click('input[class="w_V2kW"]');

I really don't know what to do anymore nor how to know the cause/debbug this...

Thanks in advance!

joelpires
  • 1
  • 1
  • 5
  • Did you try `await myPage.$eval(selector, el => el.click())` or issuing an untrusted click in the console? I'd also suggest using a [more minimal selector](https://serpapi.com/blog/puppeteer-antipatterns/#misusing-developer-tools-generated-selectors), and [not using attribute syntax](https://blog.appsignal.com/2023/06/14/puppeteer-in-nodejs-more-antipatterns-to-avoid.html#using-attribute-css-syntax-for-classes) for selecting classes. If even a single class changes, that selector will break. That said, if it's not throwing, that's probably not the problem, so this is just a best practice aside. – ggorlen Aug 10 '23 at 18:28

0 Answers0