Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Nokigiri Web
Search
Leslie Zhao
May 25, 2016
Technology
210
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Nokigiri Web
Nokigiri as a Ruby scrawler
Leslie Zhao
May 25, 2016
More Decks by Leslie Zhao
See All by Leslie Zhao
Rails实时web开发
geekontheway
0
64
Other Decks in Technology
See All in Technology
NDIでApple Vision Proにリアルタイム映像送信
jyouryuusui
0
120
事業成長とデータ活用を止めないためのマネジメントへ挑戦
hiracky16
0
390
PHPカンファレンス関西の招待状 / Invitation to PHP Conference Kansai
ykanoh
0
110
Temporal 最高!でも改めて「日付」について調べたら人類の負債すぎる件
riyaamemiya
0
150
10年後、Engineering 行為を剥奪されるとして、わたしたちは、どう、何を創ればいいだろうか。 / If Engineering Is Taken Away in 10 Years, How and What Should We Create?
bitkey
PRO
1
190
OptunaHub: ブラックボックス最適化のためのプラットフォーム
pfn
PRO
0
140
アウトプット初心者、半年間のふりかえり
4o1sobblue
0
430
ブラウザとサーバーから考えるAI時代のフロントエンド監視
shogo4131
3
940
Kiro Crewをはじめよう
kizawa2020
1
160
実践! SRE × AI - ABEMA における AIOps -
tetsuya28
8
3.1k
re:Invent初参加で変わったこと、2回目にやってみたいこと(JAWS-UG彩の国埼玉 #12)
mhrtech
2
220
Gemini Intelligence 入門 ― AppFunctions と Gemini Nano
takuroabe
0
250
Featured
See All Featured
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
940
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
310
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
260
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
WCS-LA-2024
lcolladotor
0
890
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
310
Build your cross-platform service in a week with App Engine
jlugia
234
19k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
Transcript
Nokogiri Web 解析 不是爬⾍虫
What Covers • 想法:从搜索到落地 • Demo: ⽰示例抓取演⽰示 • 解决⽅方案:异步⻚页⾯面的抓取 •
脑洞⼤大开:探索可以做的好玩事情 • 不包括:基础的代码语法
• 从指定⺴⽹网站提取数据,⽐比如电商⺴⽹网站的定价数据, ⾖豆瓣的电影书籍评分,美图⺴⽹网站的照⽚片,⼩小说⺴⽹网 站的最新章节 • 从本地或远程⽂文件中提取数据,获得分析结果 • 爬取别⼈人⺴⽹网站,需要先分析别⼈人⺴⽹网站的内容,从 ⽽而学习⼀一定的前端知识,有些⺴⽹网站的前端直接调 ⽤用的是裸接⼝口,通过分析前端⻚页⾯面,可以获得接
⼝口地址,快速干净的批量获取到我们需要的数据 Why…
Then… • 抓取数据之后,可以导出成json或保存在数据库 中,如果数据有价值,可以做成⺴⽹网站⼩小范围分享, 或者⾃自⼰己私有的RSS, 常⻅见:公众号聚合,⼩小说下 载,图⽚片分享,电商推荐 • 监控⾃自有⺴⽹网站服务状态 •
监控对⼿手⺴⽹网站服务更新 • 为⾃自⼰己的⺴⽹网站加⼊入更多属性:评分,⽐比价...
关键字
None
None
None
Nokogiri 只是⼀一个⺴⽹网⻚页解析组件,可以⽤用来实验, 不适合做爬⾍虫,可选择java或python更好 的解决⽅方案
“Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser.
Among Nokogiri's many features is the ability to search documents via XPath or CSS3 selectors.”
CSS Selector #product_list > div:nth-child(1) > a > img
XPath Selector //*[@id="product_list"]/div[1]/a/img
None
Examples
http://www.wowebook.pw/
http://www.thebeastshop.com/item/detail/S00301000013765.htm
异步⻚页⾯面的抓取使⽤用 watir-webdriver https://paddle8.com/artworks/all:popular
脑洞⼤大开 真实的抓取可能遇到 1.request ip limit 2.request cookie limit 3.request behaviour
detect 4.user account authenticate