Created
May 2, 2019 09:24
-
-
Save vipzero/50fa8b616750e8e8253e087e23b67963 to your computer and use it in GitHub Desktop.
post to 5ch from headless browser
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
import puppeteer from 'puppeteer' | |
async function main() { | |
const browser = await puppeteer.launch({ | |
headless: true, | |
args: ['--no-sandbox', '--disable-setuid-sandbox'], | |
}) | |
const page = await browser.newPage() | |
const threadURL = 'http://hebi.5ch.net/test/read.cgi/news4vip/1556625403' | |
await page.goto(threadURL) | |
await page.type('form textarea', 'Hello world') | |
await page.click('form [type=submit]') | |
await page.waitForSelector('input[value=上記全てを承諾して書き込む]') | |
await page.click('input[type=submit]') | |
page.browser.close() | |
} | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment