Created
February 18, 2020 00:07
-
-
Save psykzz/26b7e72e8f1bde4e7b88dc08aa161b50 to your computer and use it in GitHub Desktop.
Login and run droptimizer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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