-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
23 lines (22 loc) · 859 Bytes
/
Copy pathindex.js
File metadata and controls
23 lines (22 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const puppeteer = require("puppeteer");
(async () => {
const browser = await puppeteer.launch({ slowMo: 250 });
const page = await browser.newPage();
// Acessa a pagina e faz o login.
await page.goto('http://172.16.0.1/login.asp');
await page.type('[name="Username"]', 'seu usuário');
await page.type('[name="Password"]', 'sua senha');
await page.click('[class="button1"]');
// Reinicia o roteador.
await page.click('[class="btn"]');
await page.click('[href="system_hostname.asp"]');
await page.click('[href="system_reboot.asp"]');
await page.keyboard.press("Tab");
await page.keyboard.press("Tab");
await page.keyboard.press("Enter").then(
await page.on('dialog', async dialog => {
await dialog.accept();
}));
console.log("Roteador reiniciado.");
await browser.close();
})();