https://play-life.jp/articles/7025にあるdiv.box-spotの中にあるhttps://〜リンクが取れない。
import requests # pandas読み込み import pandas as pd from bs4 import BeautifulSoup from google.colab import files import requests html_doc = requests.get("https://play-life.jp/articles/7025").text # BeautifulSoupの初期化 soup = BeautifulSoup(html_doc, 'html.parser') tags = soup.find_all("div", {"class": "box-spot"}) for tag in tags.select('a[href^="https://"]'): print(tag)
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。