📜  检索元标记python代码示例中的内容

📅  最后修改于: 2022-03-11 14:45:16.370000             🧑  作者: Mango

代码示例3
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)