Advertisement
SimpleCookie

Untitled

Nov 29th, 2023 (edited)
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import {
  2.   loggaInViaMobiltBankid,
  3.   screenshot
  4. } from "../utilities";
  5.  
  6. const VIEWPORT = { width: 1920, height: 1080 };
  7. const url = "https://customerportal.intrum.com/se";
  8. const inkasso = "Intrum";
  9. const selectors = {
  10.   login: ".provider-bankid-mobile-se",
  11. };
  12.  
  13. export default {
  14.   crawl: async (browser) => {
  15.  
  16.     console.log(`\n\nCrawling ${inkasso}...`);
  17.     const page = await browser.newPage();
  18.     await page.setViewport(VIEWPORT);
  19.  
  20.     console.log(`Going to url ${url}`);
  21.     await page.goto(url);
  22.  
  23.     console.log("Going to mina sidor");
  24.     await page.waitForSelector(selectors.login, { timeout: 5000 })
  25.     await page.click(selectors.login);
  26.  
  27.     await loggaInViaMobiltBankid(page, "personnummr 199200000");
  28.  
  29.     await page.screenshot({
  30.       path: `screenshots/${inkasso}.png`,
  31.       fullPage: true
  32.     });
  33.  
  34.     const html = await page.content();
  35.     screenshot(html, inkasso)
  36.  
  37.     console.log("Done with Intrum!");
  38.     page.close();
  39.     return true;
  40.   }
  41. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement