Issue
I am trying to parse banking website and I have the whole workflow recorded in Selenium and everything works. Due to inability to persist cookies between sessions while using Selenium Webdriver (Cookies cannot be loaded - "missing name exception") I moved to puppeteer. Line by line it went good until I got the following lines:
In selenium:
await driver.findElement(By.css(".buttons:nth-child(4)")).click()
and in puppeteer
await page.frames()[1].click('.buttons:nth-child(4)');
does not work.
What is funny though:
await page.frames()[1].waitForSelector('.buttons:nth-child(4)');
does not throw exception so element is present on the page.
Solution
page.frames() will return a promise. You have to await almost everything:
let frames = await page.frames()
await frames[1].click('.buttons:nth-child(4)');
Answered By - pguardiario
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.