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
ruby conf tw 2012 build your own web scrapper
Search
Dale Ma
December 08, 2012
Programming
3
650
ruby conf tw 2012 build your own web scrapper
build your own web scrapper
Dale Ma
December 08, 2012
Tweet
Share
Other Decks in Programming
See All in Programming
マルチアカウント環境での、そこまでがんばらない RI/SP 運用設計
wa6sn
0
690
Boost Your Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
870
AI時代のプログラミング教育 / programming education in ai era
kishida
23
22k
いまさら聞けない生成AI入門: 「生成AIを高速キャッチアップ」
soh9834
15
4.3k
爆速スッキリ! Rspack 移行の成果と道のり - Muddy Web #11
dora1998
1
270
Building a macOS screen saver with Kotlin (Android Makers 2025)
zsmb
1
120
AtCoder Heuristic First-step Vol.1 講義スライド
terryu16
3
1.1k
Develop Faster With FrankenPHP
dunglas
2
3.1k
AIコードエディタの基盤となるLLMのFlutter性能評価
alquist4121
0
190
生成AIを使ったQAアプリケーションの作成 - ハンズオン補足資料
oracle4engineer
PRO
3
110
Firebase Dynamic Linksの代替手段を自作する / Create your own Firebase Dynamic Links alternative
kubode
0
220
ReactFlow への移行で実現するユーザー体験と開発体験の向上
j9141997
0
170
Featured
See All Featured
Building an army of robots
kneath
304
45k
Faster Mobile Websites
deanohume
306
31k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Building Adaptive Systems
keathley
41
2.5k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
RailsConf 2023
tenderlove
29
1k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
510
Writing Fast Ruby
sferik
628
61k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.3k
How GitHub (no longer) Works
holman
314
140k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
12
640
Transcript
Build Your Own Web Scraper - Dale Ma @eguitarz 12年12月8日星期六
@eguitarz It’s fun to do something small and easy. 12年12月8日星期六
@eguitarz I always want to build a robot to serve
me. 12年12月8日星期六
@eguitarz Since making a robot is too difficult, so I
choose to make a web bot. 12年12月8日星期六
@eguitarz Today I’m talking about how do I build my
own web scraper in ruby. 12年12月8日星期六
@eguitarz Web scrapers have many uses. For example... 12年12月8日星期六
@eguitarz Up time survey, image collecting, automate web snapshots and
more... 12年12月8日星期六
@eguitarz Usually, there are many scrapers (threads) fired at the
same time. 12年12月8日星期六
@eguitarz So, first things first, I have to control the
threads. 12年12月8日星期六
@eguitarz I decide to write #threadpool to do this such
thing. 12年12月8日星期六
@eguitarz You can find that at https:// github.com/eguitarz/threadpool 12年12月8日星期六
@eguitarz Threadpool decides the life of each thread. 12年12月8日星期六
@eguitarz Now, let’s go for the main dish. 12年12月8日星期六
@eguitarz Web scrappers should be able to `grab page` and
`parse html tags`. 12年12月8日星期六
@eguitarz #Nokogiri is good at those things. 12年12月8日星期六
@eguitarz I use “Hash” to save parsed links. 12年12月8日星期六
@eguitarz There’s a problem, links stored in hash by threads.
But hash in ruby is not thread-safe... 12年12月8日星期六
@eguitarz #hamster helps me with this. 12年12月8日星期六
@eguitarz I use `Depth-Limited Search` algorithm for my scrapper. 3
2 1 1 12年12月8日星期六
@eguitarz What if the page needs javascript to render? 12年12月8日星期六
@eguitarz There’s a easy way... use browser to render the
html with javascript. 12年12月8日星期六
@eguitarz How? 12年12月8日星期六
@eguitarz #Waltir or #Selenium 12年12月8日星期六
Gonna show my little toy... 12年12月8日星期六
@eguitarz My scraper is on github at https:// github.com/eguitarz/macaron 12年12月8日星期六
@eguitarz The demo is simple, `you` can enhance or create
new one. 12年12月8日星期六
@eguitarz Wikipedia scraper, Facebook scraper... could be interesting! 12年12月8日星期六
THANKS! 12年12月8日星期六