Skip to content

Commit

Permalink
Basic connection to website
Browse files Browse the repository at this point in the history
  • Loading branch information
TanguyLichau committed Jan 3, 2023
1 parent bea7fae commit 83a79d9
Show file tree
Hide file tree
Showing 4 changed files with 1,389 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules

.env
30 changes: 30 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const puppeteer = require("puppeteer");
require("dotenv").config();

const EMAIL = process.env.EMAIL;
const PSW = process.env.PASSWORD;

async function yo() {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();

await page.goto("https://www.leonard-de-vinci.net/");

await page.focus("#login");
await page.keyboard.type(EMAIL);
await page.click("#btn_next");

await page.waitForSelector("#passwordInput");
await page.focus("#passwordInput");
await page.keyboard.type(PSW);
await page.click("#submitButton");

//const cookies = await page.cookies(
// "https://www.leonard-de-vinci.net/?my=edt"
//);
const client = await page.target().createCDPSession();
const cookies = (await client.send("Network.getAllCookies")).cookies;
console.log("cookies : " + JSON.stringify(cookies));
}

yo();
Loading

0 comments on commit 83a79d9

Please sign in to comment.