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
F#でスクレイピングをしてみた!(F# SCRAPING)
Search
callmekohei
July 02, 2016
Programming
960
1
Share
F#でスクレイピングをしてみた!(F# SCRAPING)
2016/07/03開催のF#談話室(23)の発表資料です。
callmekohei
July 02, 2016
Other Decks in Programming
See All in Programming
Moments When Things Go Wrong
aurimas
3
120
Zod v4 Codec でスキーマに型変換を埋め込む REST API 設計 #TSKaigi2026
ryutaro_yako
0
170
RTSPクライアントを自作してみた話
simotin13
0
320
Talking to terminals (and how they talk back) (KotlinConf 2026)
jakewharton
PRO
1
160
AIエージェントの隔離技術の徹底比較
kawayu
0
440
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
480
Technical Debt: Understanding it Rightly, Engaging it Rightly #LaravelLiveJP
shogogg
0
170
Transactional Change Stream Processing With Debezium and Apache Flink
gunnarmorling
1
140
運用エージェントは "作る" から "育てる" へ - 記憶と自己進化の3層設計パターン / self-evolving-agents-three-layer-agent-design
gawa
12
3.2k
SPMマルチモジュールで テストカバレッジを取得する技法
yosshi4486
0
130
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
130
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
320
Featured
See All Featured
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
290
We Have a Design System, Now What?
morganepeng
55
8.2k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.2k
My Coaching Mixtape
mlcsv
0
140
Measuring & Analyzing Core Web Vitals
bluesmoon
9
850
Amusing Abliteration
ianozsvald
1
190
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
Utilizing Notion as your number one productivity tool
mfonobong
4
310
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
160
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
390
Transcript
F# SCRAPING F#ͰεΫϨΠϐϯάΛͯ͠Έͨʂ callmekohei 2016/07/03 Sun
Overview • ࣗݾհ • εΫϨΠϐϯάͷ͖͔͚ͬ • HTMLͷ2ͭͷऔಘํ๏ • HTML͔ΒσʔλʔΛͱΓͩͯ͠ΈΔ
callmkohei VBA 3 years F# 9 months ͷ໊લ ϨΦɻ ΑΖ͘͠Ͷʂ
εΫϨΠϐϯάͷ͖͔͚ͬ
͜Μͳײ͡Ͱ ϩτ̓ͷ༧ଌΛ ͍ͨ͠
ϩτ̓ͷબ൪߸Λ ϗʔϜϖʔδΑΓ ೖख͍ͨ͠
None
ϗʔϜϖʔδ HTMLιʔεͰ Ͱ͖͍ͯΔ
None
ϗʔϜϖʔδͷσʔλʔΛ औಘ͢Δʹ HTMLιʔε͕ඞཁ
Ͳ͏ͬͯ HTMLιʔεΛ औಘ͢Δ͔
HTMLιʔεΛऔಘ͢Δ̎ͭͷํ๏
ͦͷ̍ System.NetΛ͔ͭ͏
ͦͷ̎ PhantomJS Λ͔ͭ͏
جຊతʹ System.NetͷΈͰ େৎʢͩͱࢥ;ɻɻɻʣ ͜͜ ߟ͑Ͳ͜Ζ
Ͳ͏্ͯ͠ख͘ औಘͰ͖ͳ͍߹ PhantomJSΛͬͯΈΔ
ͨͩ PhantomJS ͍ͷͰ͢
αʔόʔͷଓൺֱ System.Net: 2s PhantomJS: 7s ࣮ߦ࣌ؒࢀߟ
͜͜Ͱ ࣮ࡍʹαʔόʔʹ ͭͳ͛ͯΈΔ demo
HTMLιʔε͔Β σʔλʔΛ ͱΓͩͯ͠ΈΔ
͜͜Ͱ ศརͳ ϥΠϒϥϦ FSharp.Data
FSharp Data ͱʁ The F# Data library implements everything you
need to access data in your F# applications and scripts. CSV, HTML, JSON and XML ʹରͯ͠ͷศརϥΠϒϥϦ http://fsharp.github.io/FSharp.Data/
a tag
͜͜Ͱ a tag Λ ͱΓͩͯ͠ΈΔ demo
table tag
͜͜Ͱ table tag Λ ͱΓͩͯ͠ΈΔ demo
εΫϨΠϐϯά͢Δͱ͖ʹ ศརͩͱࢥ͏ؔΛ ·ͱΊͯΈͨ
SCRAPINGfs https://github.com/callmekohei/SCRAPINGfs
͞Βʹɺɺ
FSharp.Data HtmlDocument.Load ͍͚ͯͳ͍ͱࢥͬͯΔͱ͜Ζ
ϒϥβʔ͡Όͳ͍ͱ͔͡ΕΔ จࣈίʔυ͕͏·͘ॲཧ͞Εͳ͍ Http Utilities Λ͏͜ͱͰղܾʂ
Formॲཧ͕Ͱ͖ͳ͍
Formॲཧ͕Ͱ͖ͳ͍ Http Utilities Λ͏͜ͱͰͪΐͬͱղܾʂ
Formॲཧ͕Ͱ͖ͳ͍ System.Net Λ͏͜ͱͰղܾʂ
؆୯ͳൺֱද
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠