-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
37 lines (25 loc) · 838 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const { config } = require('./config')
const puppeteer = require('puppeteer')
async function start () {
const browser = await puppeteer.launch({
headless: false,
args: ['--disable-notifications']
})
const page = await browser.newPage()
await page.goto(config.facebook.postUrl)
await page.type('#email', config.facebook.username)
await page.type('#pass', config.facebook.password)
await page.click('#loginbutton')
await page.waitFor(5000)
await page.goto(config.facebook.postUrl)
await page.waitFor(5000)
await page.click('[contenteditable]')
for (let index = 0; index < 1000; index++) {
await page.keyboard.type(config.facebook.commentText, { delay: 100 })
await page.keyboard.press('Enter')
await page.waitFor(1000)
}
await page.waitFor(5000)
await browser.close()
}
start()