Skip to content

Instantly share code, notes, and snippets.

@Lowell130
Forked from krmaxwell/parsing.py
Created January 7, 2018 19:28
Show Gist options
  • Save Lowell130/d1f59d56cfba717f902714b9205e7146 to your computer and use it in GitHub Desktop.
Save Lowell130/d1f59d56cfba717f902714b9205e7146 to your computer and use it in GitHub Desktop.
Meta tags and BeautifulSoup
from bs4 import BeautifulSoup
soup = BeautifulSoup(response)
metatags = soup.find_all('meta',attrs={'name':'generator'})
for tag in metatags:
print tag
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<meta content="WordPress 3.4.2" name="generator"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment