Slide 1

Slide 1 text

LINEBOT With Scraping twitter : @gin2_5 Created at 2020/02

Slide 2

Slide 2 text

ࣗݾ঺հ ֶੜʢ̎̍ࡀʣ LINE FUKUOKAʹ ɹɹɹɹɹ௕ظΠϯλʔϯ AI, IoT(ϥζύΠ) ,Java ɹɹɹɹɹɹͲΕ΋಴࠳தɻ ࢿ֨ɿԠ༻৘ใٕज़ऀ

Slide 3

Slide 3 text

࠷ۙɺ ػցֶशͷֶश ΛαϘͬͯ·͢ɻ ਺ࣜʹർΕ·ͨ͠ɻ ॏճؼͰଉ੾ΕͰ͢ɻ

Slide 4

Slide 4 text

Կ͔ɺଉൈ͖Ͱ ؔ࿈͋Δ͜ͱ͍ͨ͠ͳɻ

Slide 5

Slide 5 text

εΫϨΠϐϯάͬͯ ໘നͦ͏ɻ

Slide 6

Slide 6 text

ҰԠɺεΫϨΠϐϯάʹ͍ͭͯ “ WebεΫϨΠϐϯάͱ͸ɺWebαΠτ͔Β WebϖʔδͷHTMLσʔλΛऩूͯ͠ɺಛ ఆͷσʔλΛநग़ɺ੔ܗ͠௚͢͜ͱͰ͋Δ ” (weblio ༷ΑΓҾ༻)

Slide 7

Slide 7 text

HTML File Python Something (DB,File, and more) Scrape Output About scraping

Slide 8

Slide 8 text

Α͘ɺ͜Μͳ͜ͱ͋Γ·ͤΜ͔ʁ ໘നͦ͏ͳITܥͷΠϕϯτΛݟಀͪ͠Όͬͨɻ ؾ෇͍ͨΒɺఆһ͍ͬͺ͍ɻ ʢओʹ๻Ͱ͢ʣ

Slide 9

Slide 9 text

࡞Γ·ͨ͠ LINEͰΠϕϯτΛ ௨஌ɾݕࡧͯ͘͠ΕΔౕ

Slide 10

Slide 10 text

heroku ߏ੒ DB LINE API Flask python cron (ఆظతʹಈ͘) python Connpassͷ ެࣜαΠτ (HTMLϑΝΠϧ)

Slide 11

Slide 11 text

݁ߏ؆୯ʹεΫϨΠϐϯάग़དྷͪΌ͍·ͨ͠ $ pip install beautifulsoup4 from bs4 import BeautifulSoup import requests bash scrape.py Install Import

Slide 12

Slide 12 text

url = ’https:!//something.com' r = requests.get(url) soup = BeautifulSoup(r.content, "html.parser") events_name = soup.select('a.url.summary') events_date = soup.select('p.date') events_year = soup.select('p.year') events_img = soup.select('p.event_thumbnail img') scrape.py

Slide 13

Slide 13 text

ͨͩɺਅ໘໨ͳ࿩ɻ Web APIΛ࢖͍ͬͯΔΘ͚Ͱ͸ͳ͍ͷͰɺ ϖʔδͷߏ੒Λม͑ΒΕͨΒɺऴΘΓ·͢ɻ ࣗવݴޠॲཧͱ͔΋བྷΊͯ΍ͬͯΈ͍ͨͳ

Slide 14

Slide 14 text

͓͠·͍ɻ ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

!<- ͜Εɺ શ֯ʮzʴhʯ Ͱೖྗग़དྷ·͢ ͓·͚