↓こちらのサイトを参考に、Beautiful Soup を使って metaタグのog:urlを抽出してみる
import requests
from bs4 import BeautifulSoup
url = "【URLが入ります】"
res = requests.get(url)
soup = BeautifulSoup(res.text, "html.parser")
og_url = soup.find_all(attrs={"property": "og:url"})
↓こちらのサイトを参考に、Beautiful Soup を使って metaタグのog:urlを抽出してみる
import requests
from bs4 import BeautifulSoup
url = "【URLが入ります】"
res = requests.get(url)
soup = BeautifulSoup(res.text, "html.parser")
og_url = soup.find_all(attrs={"property": "og:url"})