soup = BeautifulSoup(webpage) for tag in soup.find_all("meta"): if tag.get("property", None) == "og:title": print tag.get("content", None) elif tag.get("property", None) == "og:url": print tag.get("content", None)