[python] Quickly fetch web page metadata with lassie

Hello. It's been hot these days. When it gets hot, I'm tired of patrolling pages and extracting elements. Let's get rid of this quickly with python's lassie.

lassie

https://github.com/michaelhelmick/lassie

Web Content Retrieval for Humans™

That's right

installation

pip install lassie

You can go from pip

usage

>> import lassie
>> fetched = lassie.fetch('http://www.youtube.com/watch?v=tkjbEqnp_0U')

Only this.

Contents is like this.

>> from pprint import pprint
>> pprint(fetched)

{'description': u'Recording of the July 12, 2013 webcast, 	"What\'s New in Riak 1.4"',
 'images': [{'src': u'http://b.vimeocdn.com/ts/	445/011/445011693_640.jpg',
	         'type': u'og:image'}],
 'title': u"What's New in Riak 1.4",
 'url': u'http://vimeo.com/71448923',
 'videos': [{'height': 400,
         'src': u'http://vimeo.com/moogaloop.swf?clip_id=71448923',
         'type': u'application/x-shockwave-flash',
         'width': 640},
        {'height': 400,
         'src': u'https://player.vimeo.com/video/71448923',
         'width': 640}]}

The title, description, keywords (though not shown here), images, videos, etc. will be extracted and returned. I hate that thumbnail candidates are also returned with a type.

It seems that you can spend the hot summer calmly.

dependencies setup.py

    install_requires=[
    'requests==1.2.3',
    'beautifulsoup4==4.2.1',
    'html5lib==1.0b3'
    ],

It's familiar.

lassie [Noun] [Countable noun] << Scottish dialect >> Daughter, girl; young lady (⇔ laddie). [LASS+‐IE]

Meaning of lassie-English-Japanese dictionary Weblio dictionary

I see

Um, maybe

Lassie

"Lassie" is a nickname for "the handmaiden / girl" in English, and of course Lassie is a female collie.

[Lassie-Wikipedia](http://ja.wikipedia.org/wiki/%E5%90%8D%E7%8A%AC%E3%83%A9%E3%83%83%E3%82%B7% E3% 83% BC)

I did not know. It will be studying.

Recommended Posts

[python] Quickly fetch web page metadata with lassie
[Personal note] Web page scraping with python3
[python, ruby] fetch the contents of a web page with selenium-webdriver
Extract data from a web page with Python
Web scraping with python + JupyterLab
Web API with Python + Falcon
Web application with Python + Flask ② ③
Web scraping beginner with python
Streamline web search with python
Web application with Python + Flask ④
[Part.2] Crawling with Python! Click the web page to move!
Web scraping with Python ① (Scraping prior knowledge)
Web scraping with BeautifulSoup4 (layered page)
Web scraping with Python First step
I tried web scraping with python.
Monitor Python web apps with Prometheus
Get web screen capture with python
WEB scraping with Python (for personal notes)
Getting Started with Python Web Scraping Practice
Quickly create an excel file with Python #python
Page cache in Python + Flask with Flask-Caching
Daemonize a Python web app with Supervisor
Web scraping with Python ② (Actually scraping stock sites)
Download files on the web with Python
Horse Racing Site Web Scraping with Python
Monitor web page updates with LINE BOT
[Python] A quick web application with Bottle!
Getting Started with Python Web Scraping Practice
Easy web app with Python + Flask + Heroku
[Python] Quickly create an API with Flask
Run a Python web application with Docker
Let's make a web framework with Python! (1)
Practice web scraping with Python and Selenium
Easy web scraping with Python and Ruby
Web scraping with BeautifulSoup4 (serial number page)
Let's make a web framework with Python! (2)
[For beginners] Try web scraping with Python
AWS-Perform web scraping regularly with Lambda + Python + Cron
Color page judgment of scanned image with python
Python Web Content made with Lolipop cheap server
Vienna with Python + Flask web app on Jenkins
Introduction to Tornado (1): Python web framework started with Tornado
[Web development with Python] query is also redirect
Create a page that loads infinitely with python
Start a simple Python web server with Docker
Make your own module quickly with setuptools (python)
Launch a web server with Python and Flask
Explosive speed with Python (Bottle)! Web API development
Create a new page in confluence with Python
Quickly build a Python Django environment with IntelliJ
Let's do web scraping with Python (weather forecast)
Let's do web scraping with Python (stock price)
[Web development with Python] Precautions when saving cookies
Create an API server quickly with Python + Falcon
FizzBuzz with Python3
Scraping with Python
Statistics with python
Scraping with Python
Python with Go
Twilio with Python
Integrate with Python