Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

How do I wait for setTimeout on the page? #148

Open
sbc640964 opened this issue Aug 10, 2021 · 1 comment
Open

How do I wait for setTimeout on the page? #148

sbc640964 opened this issue Aug 10, 2021 · 1 comment

Comments

@sbc640964
Copy link

    $puppeteer = new \Nesk\Puphpeteer\Puppeteer();
    $browser = $puppeteer->launch();
    $page = $browser->newPage();
   
    $page
        ->goto('path-topage-with-settimeout-1000');
       
    $page->waitForTimeout(3000);

    $page->screenshot(['path' => 'example.png']); // result the base page;
@stanolacko
Copy link

stanolacko commented Aug 11, 2021

@method \Nesk\Puphpeteer\Resources\HTTPResponse\|null goto(string $url, array{ referer: string, timeout: float, waitUntil: string\|string[] } $options = null)

You have to set timeout as option
$page->goto($url,['timeout'=>3000]);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants