Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const puppeteer = require('puppeteer');
  2.  
  3.   const options = {
  4.   path: 'Pantallazo.png',
  5.   fullPage: false,
  6.   clip: {
  7.     x: 0,
  8.     y: 0,
  9.     width: 1280,
  10.     height: 1150
  11.   }
  12. }
  13.  
  14. puppeteer.launch().then(async browser => {
  15.   const page = await browser.newPage();
  16.   await page.setViewport({ width: 1280, height: 800 });
  17.   await page.goto('https://portalcfdi.facturaelectronica.sat.gob.mx/');
  18.   await page.screenshot(options);
  19.   await page.goto('https://cfdiau.sat.gob.mx/nidp/app/login?id=SATx509Custom');
  20.   await page.waitForNavigation({ waitUntil: 'load' });
  21.  
  22.   const txtCertificate = await page.$('#fileCertificate');
  23.   await txtCertificate.uploadFile('/angel/proyectos/FIEL/ura930831kb3.cer');
  24.  
  25.   const txtPrivateKey = await page.$('#filePrivateKey');
  26.   await txtPrivateKey.uploadFile('/angel/proyectos/FIEL/Claveprivada_FIEL_URA930831KB3_20161107_181656.key');
  27.  
  28.   await page.screenshot({path: 'scren.png'});
  29.  
  30.   await browser.close();
  31.  
  32. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement