Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const puppeteer = require('puppeteer');
- const options = {
- path: 'Pantallazo.png',
- fullPage: false,
- clip: {
- x: 0,
- y: 0,
- width: 1280,
- height: 1150
- }
- }
- puppeteer.launch().then(async browser => {
- const page = await browser.newPage();
- await page.setViewport({ width: 1280, height: 800 });
- await page.goto('https://portalcfdi.facturaelectronica.sat.gob.mx/');
- await page.screenshot(options);
- await page.goto('https://cfdiau.sat.gob.mx/nidp/app/login?id=SATx509Custom');
- await page.waitForNavigation({ waitUntil: 'load' });
- const txtCertificate = await page.$('#fileCertificate');
- await txtCertificate.uploadFile('/angel/proyectos/FIEL/ura930831kb3.cer');
- const txtPrivateKey = await page.$('#filePrivateKey');
- await txtPrivateKey.uploadFile('/angel/proyectos/FIEL/Claveprivada_FIEL_URA930831KB3_20161107_181656.key');
- await page.screenshot({path: 'scren.png'});
- await browser.close();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement