Upgrade to Pro — share decks privately, control downloads, hide ads and more …

私の生活を変えたHeadless Chrome / Headless Chrome who c...

taminif
November 24, 2018

私の生活を変えたHeadless Chrome / Headless Chrome who changed my life

Nodefest 2018 LT

taminif

November 24, 2018
Tweet

More Decks by taminif

Other Decks in Programming

Transcript

  1. AWS IoT 1-Click • Amazon Dash Buttonϋʔυ΢ΣΞΛϕʔεͱͨ͠
 ϓϩάϥϛϯάՄೳͳϘλϯ • ࢖͍ํ͸Amazon

    Dash Buttonͱಉ͡Ͱ
 ϘλϯΛԡͨ࣌͠ͷૢ࡞͕બ΂Δ • ྨࣅσόΠε΋ॱ࣍ൃച͍ͯ͠Δ • SORACOM LTE-M Button powered by AWSͳͲ
  2. ࣮૷͢Δ const puppeteer = require('puppeteer'); (async () => { const

    browser = await puppeteer.launch({headless: true}); const page = await browser.newPage(); await page.setViewport({width: 640, height: 460}); await page.goto('https://order.yodobashi.com/yc/login/ index.html'); //////////////////////////////////////////// })(); $ISPNFΛىಈ ৽͍͠λϒΛ։͘ ΢Οϯυ΢αΠζΛܾఆ 63-Λࢦఆͯ͠ભҠ
  3. ࣮૷͢Δ //////////////////////////////////////////// await page.type('#memberId', '********'); await page.type('#password', '********'); page.click('#js_i_login0'); await

    page.waitForSelector('#wrapper'); await page.goto('https://www.yodobashi.com/product/ 100000001002383900/'); //////////////////////////////////////////// ϩάΠϯ৘ใΛೖྗ ϩάΠϯϘλϯΛΫϦοΫ ભҠΛ଴ͭ 63-Λࢦఆͯ͠ભҠ