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
PHPで書いたAPIをGoに書き換えてみた 〜パフォーマンス改善の可能性を探る実験レポート〜
koguuum
0
160
AI Agents with JavaScript
slobodan
0
230
Optimizing JRuby 10
headius
0
320
これだけは知っておきたいクラス設計の基礎知識 version 2
masuda220
PRO
24
6.4k
RubyKaigi Dev Meeting 2025
tenderlove
1
150
Enterprise Web App. Development (1): Build Tool Training Ver. 5
knakagawa
1
110
音声プラットフォームのアーキテクチャ変遷から学ぶ、クラウドネイティブなバッチ処理 (20250422_CNDS2025_Batch_Architecture)
thousanda
0
180
ウォンテッドリーの「ココロオドル」モバイル開発 / Wantedly's "kokoro odoru" mobile development
kubode
1
140
ミリしらMCP勉強会
watany
4
760
大LLM時代にこの先生きのこるには-ITエンジニア編
fumiyakume
7
3k
The Nature of Complexity in John Ousterhout’s Philosophy of Software Design
philipschwarz
PRO
0
100
Road to RubyKaigi: Making Tinny Chiptunes with Ruby
makicamel
4
190
Featured
See All Featured
Building Adaptive Systems
keathley
41
2.5k
RailsConf 2023
tenderlove
30
1.1k
Statistics for Hackers
jakevdp
798
220k
Fireside Chat
paigeccino
37
3.4k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
Java REST API Framework Comparison - PWX 2021
mraible
30
8.5k
Six Lessons from altMBA
skipperchong
27
3.7k
Thoughts on Productivity
jonyablonski
69
4.6k
Mobile First: as difficult as doing things right
swwweet
223
9.6k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
23
2.6k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
660
Making the Leap to Tech Lead
cromwellryan
133
9.2k
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日星期六