README.md code fails #16
Answered
by
Arjun31415
Arjun31415
asked this question in
Q&A
-
import LinvoScraper from "./dist/linkedin.service.js";
import * as puppeteer from "puppeteer";
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
const cdp = await page.target().createCDPSession();
// add ghost-cursor for maximum safety
await LinvoScraper.tools.loadCursor(page, true);
console.log("Going in");
// Login with Linkedin
const { token } = await LinvoScraper.services.login.process(page, cdp, {
user: "asdf",
password: "I use Arch btw 1234",
});
console.log("Cookie");
// set cookies
await page.setCookie({
name: "li_at",
value: token,
httpOnly: true,
secure: true,
sameSite: "None",
priority: "Medium",
path: "/",
domain: ".www.linkedin.com",
});
await LinvoScraper.services.connect.process(page, cdp, {
message: "Hi Nevo! Let's connect!",
url: "https://www.linkedin.com/in/nevo-david/",
}); Running it with I get the error-
How do I fix this? |
Beta Was this translation helpful? Give feedback.
Answered by
Arjun31415
Oct 10, 2022
Replies: 1 comment
-
Fixed in latest version, It was happening because the browser frame size was not specified in the example code |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Arjun31415
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixed in latest version,
It was happening because the browser frame size was not specified in the example code