Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object not clicked with puppeteer-real-browser, but with stock puppeteer it works #196

Closed
meinnamehier opened this issue Oct 11, 2024 · 4 comments
Assignees
Labels
triage This ticket will be looked at shortly

Comments

@meinnamehier
Copy link

Description

Description
When I try to click a certain element with puppeteer-real-browser, i get a timeout. When I use stock puppeteer, it works. The element is within a SVG object.

Expected Outcome:
The element #selectedSeat14041_0_96 is clicked and a overlay with an image appears
Actual outcome:
Timeout

Full steps to reproduce the issue

Here is the code that works:

const puppeteer = require('puppeteer');

puppeteer.launch({headless:false}).then(async (browser) => {
const page = await browser.newPage();
await page.setViewport({width: 1600, height: 1200});
await page.goto('https://tickets-campus.fcbayern.com/shop?shopid=3');
await page.locator('pierce/[data-testid="uc-accept-all-button"]').click();
await page.locator('article:nth-of-type(2) div.d-none > span').click();
await page.locator('#selectedSeat14041_0_96').click();
//await browser.close();
})

here is the code that does not work

const { connect } = require("puppeteer-real-browser")
async function test() {
    const { browser, page } = await connect({
        headless: false,
        args: [],
        customConfig: {},
        turnstile: true,
        connectOption: {},
        disableXvfb: false,
        ignoreAllFlags: false
    })
await page.goto('https://tickets-campus.fcbayern.com/shop?shopid=3');
await page.locator('pierce/[data-testid="uc-accept-all-button"]').click();
await page.locator('article:nth-of-type(2) div.d-none > span').click();
await page.locator('#selectedSeat14041_0_96').click();
//await browser.close();
}
test()

Issue Type

Others

Operating System

Mac OS

Do you use Docker?

I don't use Docker

@meinnamehier meinnamehier added the triage This ticket will be looked at shortly label Oct 11, 2024
@meinnamehier meinnamehier changed the title Object not clicked with puppeteer-real-browser, btu stock puppeteer works Object not clicked with puppeteer-real-browser, but with stock puppeteer it works Oct 11, 2024
@barutlift
Copy link

barutlift commented Oct 30, 2024

fix browser language option.
maybe it works

await page.setExtraHTTPHeaders({
'Accept-Language': 'en-US,en;q=0.9'
});
await page.reload();

and add waitforselector to your code maybe website or selector is not loading

await page.waitForSelector('pierce/[data-testid="uc-accept-all-button"]', { timeout: 30000 });
await page.locator('pierce/[data-testid="uc-accept-all-button"]').click();

@aguyinmontreal
Copy link

I am following this issue because I think I noticed some issues with waitForSelector and waitForFunction, but I cannot really pinpoint them.

@diegodurrod
Copy link

Here the same error with:
await page.click('input');

And:
await page.type('input', anyValue);

The output error is:
Error: Node is either not clickable or not an Element

But hover function works:
await page.hover('input');

The page is fully loaded and with stock puppeteer (and rebrowser-puppeteer) works like a charm.

@mdervisaygan
Copy link
Member

#136 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage This ticket will be looked at shortly
Projects
None yet
Development

No branches or pull requests

5 participants