Skip to content

Instantly share code, notes, and snippets.

@psykzz
Created February 18, 2020 00:07
Show Gist options
  • Save psykzz/26b7e72e8f1bde4e7b88dc08aa161b50 to your computer and use it in GitHub Desktop.
Save psykzz/26b7e72e8f1bde4e7b88dc08aa161b50 to your computer and use it in GitHub Desktop.
Login and run droptimizer
const puppeteer = require('puppeteer');
const username = "EMAIL";
const password = "PASSWORD";
const server = "eu"
const server = "ravenholdt"
const server = "kalei"
const mythicLevel = "11"
(async () => {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
await page.goto('https://www.raidbots.com/auth', { waitUntil: 'networkidle2' });
await page.type('input[type=email]', username)
await page.type('input[type=password]', password)
const [loginButton] = await page.$x("//button[contains(text(), 'Login')]");
if (loginButton) {
await loginButton.click();
}
await page.waitForNavigation()
await page.goto('https://www.raidbots.com/simbot/droptimizer', { waitUntil: 'networkidle2' });
await page.select('#ArmoryInput-armoryRegion', server)
await page.click("#ArmoryInput-armoryRealm")
await page.type("#ArmoryInput-armoryRealm", realm)
await page.type("#ArmoryInput-armoryRealm", String.fromCharCode(13))
await page.type('#ArmoryInput-armorySearch', character)
await page.waitForSelector('svg[data-id=geomicon-refresh]')
const [mythicplusSelector] = await page.$x("//p[contains(text(), 'Mythic+')]");
if (mythicplusSelector) {
await mythicplusSelector.click();
}
const [mythic11Selector] = await page.$x(`//p[contains(text(), 'Mythic ${mythicLevel}')]`);
if (mythic11Selector) {
await mythic11Selector.click();
}
const [runDroptimizer] = await page.$x("//div[contains(text(), 'Run Droptimizer')]");
if (runDroptimizer) {
await runDroptimizer.click();
}
await page.waitForNavigation()
console.log(page.url());
await browser.close();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment