Mixnode 讓操做網絡資源和數據庫同樣簡單,不同的爬蟲!

簡評: hacker news 上刷的一篇文章,能夠使用相似操做數據庫的方式訪問網絡上的資源,能夠大大簡化爬蟲的代碼。

Mixnode 將網絡變成了一個巨大的數據庫!換句話說,Mixnode 容許您將 Web 上的全部網頁,圖像,視頻,PDF文件和其餘資源視爲數據庫表中的行,至關於一個包含數萬億行的巨型數據庫表,您能夠使用標準結構化查詢語言(SQL)進行查詢。所以,您能夠使用熟悉的語言編寫簡單查詢,而不是運行 Web 爬蟲/抓取工具,來實時檢索網上各類有趣的信息。html

舉個例子:node

我麼能夠使用下面的語句來直接查詢 url 的資源web

select 
    url,
    string_between(content, '<title>', '</title>') as title
from
    resources
where
    content_type like 'text/html%'

能夠直接獲得以下的結果:數據庫

url	                                                                                    title
https://stackoverflow.com/questions/8318911/why-does-html-think-chucknorris-is-a-color      [Why does HTML think 「chucknorris」 is a color? - Stack Overflow]
https://en.wikipedia.org/wiki/List_of_animals_with_fraudulent_diplomas                 	    [List of animals with fraudulent diplomas - Wikipedia]
https://www.amazon.co.jp/dp/B06XXQD54H/	                                                    [Amazon | アクータメンツ フィンガーリス 指人形 フィンガーパペット 指人形 | おもちゃ雑貨 | おもちゃ]
https://www.reddit.com/r/funny/comments/5yhipb/its_a_bit_breezy_out_there_today/	    [It's a bit breezy out there today : funny]
https://imgur.com/gallery/cJO834B	                                                    [Just cause you pelican doesn't mean you pelishould - Album on Imgur]

 

原文: Turn the web into a database: An alternative to web crawling/scraping - Mixnode News Blog
相關文章
相關標籤/搜索