Skip to content

Instantly share code, notes, and snippets.

View IAMOTZ's full-sized avatar
💭
Writing instructions for a machine<computer>

Tunmise Ogunniyi IAMOTZ

💭
Writing instructions for a machine<computer>
View GitHub Profile
@IAMOTZ
IAMOTZ / index.js
Created November 3, 2021 22:40
Web Automation Script To Endlessly Vote Wizkid at EMA 2021 Awards
const puppeteer = require('puppeteer');
const vote = async () => {
let browser = null;
try {
const voteUrl = 'https://www.mtvema.com/en-africa/vote/';
browser = await puppeteer.launch({ headless: true });
let page = await browser.newPage();
@IAMOTZ
IAMOTZ / fix.md
Created April 29, 2021 17:32
Fix for CI Error: "Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`."

Error:

CI pipeline buld fails with an error looking like this:

error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Cause:

  • The CI tool is trying to install project dependencies using yarn install --frozen-lockfile
@IAMOTZ
IAMOTZ / puppeteer-wait-for-element-disappear.js
Created February 23, 2021 19:05
Puppeteer: Wait for element to not be in the DOM
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
const elementSelector = 'div.some-class';
await page.waitForFunction(selector => !elem, {}, elementSelector);
// Now, the element is not more in the DOM