Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
try to scraping with linebot
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Gin
February 13, 2020
Technology
290
1
Share
try to scraping with linebot
Gin
February 13, 2020
More Decks by Gin
See All by Gin
Cで理解するソケットプログラミング
gin2525
0
540
論理と感覚
gin2525
0
260
Other Decks in Technology
See All in Technology
LLM時代のリファクタリング戦略_AIエージェントによる段階的・安全なTS移行方法
play_inc
0
180
AIが変えた"品質の守り方"
kkakizaki
11
3.8k
TSKaigi 2026 - 10秒のビルドを1秒へ:tsdownが切り拓く2026年のTypeScriptライブラリ開発
teamlab
PRO
2
270
自称宇宙最速で不合格となったAIP-C01にリベンジを果たすべくAIで問題集アプリを作ってみた。
yama3133
0
170
NFLコンペ2026 解法
lycorptech_jp
PRO
0
110
freee-mcpを Local→Remote で出してわかった MCP認可実装のリアル
terara
3
640
AI時代の私の技術インプットとアウトプット術
tonkotsuboy_com
12
6.1k
食べログのサーキットブレーカー導入を振り返って
atpons
0
110
なぜハノーバーメッセに行くべきなのか 〜初参加だから語れること〜
tanakaseiya
0
120
組織の中で自分を経営する技術
shoota
0
150
oracle-to-databricks-migration-with-llm-and-dbt
casek
0
160
エンジニアは生成AIと どのように向き合うべきか? ことばの意味という観点から
verypluming
3
220
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
KATA
mclloyd
PRO
35
15k
RailsConf 2023
tenderlove
30
1.4k
Mind Mapping
helmedeiros
PRO
1
210
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.1k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
340
4 Signs Your Business is Dying
shpigford
187
22k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
120
Color Theory Basics | Prateek | Gurzu
gurzu
0
320
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
Side Projects
sachag
455
43k
Transcript
LINEBOT With Scraping twitter : @gin2_5 Created at 2020/02
ࣗݾհ ֶੜʢ̎̍ࡀʣ LINE FUKUOKAʹ ɹɹɹɹɹظΠϯλʔϯ AI, IoT(ϥζύΠ) ,Java ɹɹɹɹɹɹͲΕ࠳தɻ ࢿ֨ɿԠ༻ใٕज़ऀ
࠷ۙɺ ػցֶशͷֶश ΛαϘͬͯ·͢ɻ ࣜʹർΕ·ͨ͠ɻ ॏճؼͰଉΕͰ͢ɻ
Կ͔ɺଉൈ͖Ͱ ؔ࿈͋Δ͜ͱ͍ͨ͠ͳɻ
εΫϨΠϐϯάͬͯ ໘നͦ͏ɻ
ҰԠɺεΫϨΠϐϯάʹ͍ͭͯ “ WebεΫϨΠϐϯάͱɺWebαΠτ͔Β WebϖʔδͷHTMLσʔλΛऩूͯ͠ɺಛ ఆͷσʔλΛநग़ɺܗ͢͜͠ͱͰ͋Δ ” (weblio ༷ΑΓҾ༻)
HTML File Python Something (DB,File, and more) Scrape Output About
scraping
Α͘ɺ͜Μͳ͜ͱ͋Γ·ͤΜ͔ʁ ໘നͦ͏ͳITܥͷΠϕϯτΛݟಀͪ͠Όͬͨɻ ؾ͍ͨΒɺఆһ͍ͬͺ͍ɻ ʢओʹͰ͢ʣ
࡞Γ·ͨ͠ LINEͰΠϕϯτΛ ௨ɾݕࡧͯ͘͠ΕΔౕ
heroku ߏ DB LINE API Flask python cron (ఆظతʹಈ͘) python
Connpassͷ ެࣜαΠτ (HTMLϑΝΠϧ)
݁ߏ؆୯ʹεΫϨΠϐϯάग़དྷͪΌ͍·ͨ͠ $ pip install beautifulsoup4 from bs4 import BeautifulSoup import
requests bash scrape.py Install Import
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
ͨͩɺਅ໘ͳɻ Web APIΛ͍ͬͯΔΘ͚Ͱͳ͍ͷͰɺ ϖʔδͷߏΛม͑ΒΕͨΒɺऴΘΓ·͢ɻ ࣗવݴޠॲཧͱ͔བྷΊͯͬͯΈ͍ͨͳ
͓͠·͍ɻ ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ
None
!<- ͜Εɺ શ֯ʮzʴhʯ Ͱೖྗग़དྷ·͢ ͓·͚