Last active
August 4, 2022 01:18
-
-
Save tuna2134/6653af86eadff7d3fc67db4b4864ce9d to your computer and use it in GitHub Desktop.
Linestampを抽出するためのコードです。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
r = requests.get("https://store.line.me/stickershop/product/13584756/ja") | |
soup = BeautifulSoup(r.content, "html.parser") | |
urls = [] | |
for span in soup.find_all("span", class_="mdCMN09Image"): | |
if not span.get("style")[21:-2] in urls: | |
urls.append(span.get("style")[21:-2]) | |
with open("urls.txt", "w") as f: | |
f.write("\n".join(url for url in urls)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment