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

Puppeteerに操られた話.pdf

 Puppeteerに操られた話.pdf

628e0315d9e5b21ec7ff8509e174d326?s=128

yagirihara

March 08, 2019
Tweet

Transcript

  1. PuppeteerʹૢΒΕͨ࿩ 2019/03/08 Tech Do 1प೥ه೦ ࣾ಺֎ษڧձ Airitechגࣜձࣾ ༄ݪӳथ

  2. Tech Do ̍प೥͓ΊͰͱ͏͍͟͝·͢ʂ

  3. ࣗݾ঺հ • ༄ݪ ӳथ • झຯɿεϙʔπʢےτϨɺ໺ٿɺϚϥιϯʣ • ॴଐɿAiritechגࣜձࣾ • ۀ຿ɿݕࡧΤϯδϯɺWebαʔϏε։ൃ

    • ݴޠɿJava, PythonʢElasticsearch, Angular, Laravelʣ
  4. Puppetterͱ͸ • Chromeͷૢ࡞APIΛؚΜͩNode Library • E2EςετɺεΫϨΠϐϯάͳͲͷ
 ࣗಈϒϥ΢βૢ࡞ʹར༻ • Chrome DevTools

    team͕ϝϯςφϯε • Star : 46,284 (selenium : 13,605)
  5. None
  6. ಛ௃ • install͕؆୯ • headless/full browserʹରԠ • high performance, stable

    • ๛෋ͳAPIʢscreenshot, trace…ʣ • Devtoolsͷ৘ใΛऔಘՄೳ
  7. ࢖͍ํ $ npm i puppeteer $ node example.js γφϦΦΛ ॻ͘

  8. Puppeteer Recorder • Chrome֦ு • ϒϥ΢βͷૢ࡞Λه࿥ • γφϦΦͷίʔυʢDOMʣΛࣗಈ࡞੒

  9. None
  10. ͜Ε͸؆୯ʂ

  11. Puppeteerૢͬͨͬͨʂ

  12. ඇಉظॲཧʢasync/awaitؔ਺ʣʹ͸·Δ • ޡΓ • ਖ਼͍͠


  13. ࣗಈ࡞੒͚ͩͰ͸ݶք͋Γ • ϩʔσΟϯά଴ͪ • ϙοϓΞοϓ

  14. ࣗ෼͕ૢΒΕ͍ͯͨ

  15. Ͱ΋΍ͬͺΓศར • PuppeteerͰ͔͠Ͱ͖ͳ͍͜ͱ͕ଟ͍
 ˠ ಛʹDevtools·ΘΓ • Ԟ͕ਂ͍(DOMૢ࡞ɺϑΝΠϧΞοϓϩʔυ) • όʔδϣϯΞοϓʹظ଴

  16. ৄ͘͠͸

  17. ͝੩ௌ͋Γ͕ͱ͏ ͍͟͝·ͨ͠ʂ