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
700
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
フロントエンド開発のためのブラウザ組み込みAI入門
masashi
7
3.7k
PHPライセンス変更の議論を通じて学ぶOSSライセンスの基礎
matsuo_atsushi
0
110
Researchlyの開発で参考にしたデザイン
adsholoko
0
110
Amazon ECS Managed Instances が リリースされた!キャッチアップしよう!! / Let's catch up Amazon ECS Managed Instances
cocoeyes02
0
130
Blazing Fast UI Development with Compose Hot Reload (Bangladesh KUG, October 2025)
zsmb
2
480
Swift Concurrency 年表クイズ
omochi
3
220
alien-signals と自作 OSS で実現する フレームワーク非依存な ロジック共通化の探求 / Exploring Framework-Agnostic Logic Sharing with alien-signals and Custom OSS
aoseyuu
3
5.7k
퇴근 후 1억이 거래되는 서비스 만들기 | 내가 AI를 사용하는 방법
maryang
2
480
NIKKEI Tech Talk#38
cipepser
0
400
React Nativeならぬ"Vue Native"が実現するかも?_新世代マルチプラットフォーム開発フレームワークのLynxとLynxのVue.js対応を追ってみよう_Vue Lynx
yut0naga1_fa
2
2k
AI駆動開発カンファレンスAutumn2025 _AI駆動開発にはAI駆動品質保証
autifyhq
0
130
釣り地図SNSにおける有料機能の実装
nokonoko1203
0
210
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
49
14k
The Cost Of JavaScript in 2023
addyosmani
55
9.1k
Designing Experiences People Love
moore
142
24k
How GitHub (no longer) Works
holman
315
140k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
Unsuck your backbone
ammeep
671
58k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Six Lessons from altMBA
skipperchong
29
4.1k
Music & Morning Musume
bryan
46
6.9k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
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日星期六