0

I am trying to access a button within an iframe on this site: https://jklm.fun/?fromOldGames (the bomb party rooms).

The button in question is this one: enter image description here

I have been able to access the iframe as such let frame = await page.frames()[0]; however when I try grab the button by class name it apparently doesn't exist and when I grab every button element on the page/in the frame like this let buttons = await frame.$$("button"); they are all "Unclickable nodes or not HTMLElements".

I was able to tell that the buttons are being returned as ElementHandles but according to puppeteer docs I should be able to use the click() method.

I'm not quite sure why the handles would be unclickable or what I need to do to change that.

Somewhat unrelated, page.$$("button") and frame.$$("button") both return exactly 8 element handles while there are 11 buttons on the page, is there a reasonable explanation for this as well?

iris87
  • 103
  • 1
  • 2
  • 11

1 Answers1

0

Here is what you can do:

const frame = await iframe.contentFrame();

await frame.evaluate(() => {
  document.querySelector(".join").children.click();
}).then(async() => {

}

If you got an update to your post : Detecting socket.io events in an HTML game, please edit it

Tyler2P
  • 2,324
  • 26
  • 22
  • 31
abaoui
  • 1
  • 1
  • how are you fetching the frame? im getting "contentFrame(); is not a function" – iris87 Dec 12 '22 at 22:56
  • `page.waitForSelector("iframe").then(() => { page.$("iframe").then(async (iframe) => { const frame = await iframe.contentFrame(); }); }); ` You should check this repo : https://github.com/IsaacLaquerre/BombPartyBot, has everything you need – abaoui Dec 15 '22 at 15:42