Home > Mobile >  puppeteer-sharp how to wait requests
puppeteer-sharp how to wait requests

Time:01-10

how to wait request to be done before clicking on btn in puppeteer-sharp ?

what I am trying to do is:

1.click on btn ( to make ajax request on website )
2.wait request to be done
3.click on submit btn

what I am doing now is:

1.click on btn ( to make ajax request on website ) await page.ClickAsync("#id")
2.wait for some time ( await page.WaitForTimeoutAsync(2000); )
3.click on submit btn

CodePudding user response:

this is the method I was looking for to wait for the request to be done :
await page.WaitForResponseAsync()

  • Related