Rakan Habab
Rakan Habab

Reputation: 146

how to Ctrl+A page and Input that into a string

I am making a puppeteer program were it checks Google Docs I want to be able to select all the text in the Google Docs and be able to make it into a string or a variable

I tried to Copy the text in the Google docs But didn't know where to go from there

await page2.keyboard.down('Control');
await page2.keyboard.press('KeyA');
await page2.keyboard.press('KeyC');
await page2.keyboard.up('Control');

I don't know where to go from here

Upvotes: 2

Views: 5335

Answers (1)

Raz Shlomo
Raz Shlomo

Reputation: 21

try

    await page.keyboard.down('ControlLeft')
    await page.keyboard.press('KeyA')
    await page.keyboard.press('KeyC');
    await page.keyboard.up('ControlLeft')

Upvotes: 2

Related Questions