ヨドバシドットコム購入明細メールの商品一覧から商品名と価格を抜き出す
This file contains 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 re | |
import pyperclip | |
import sys | |
from time import sleep | |
n = [] | |
p = [] | |
text = pyperclip.paste() | |
for m in re.finditer(r"「([^」]*)」", text, re.MULTILINE): | |
n.append(re.sub(r"\n\s*", "", m[1])) | |
for m in re.finditer(r"([\d,]+)\s*円", text, re.MULTILINE): | |
p.append(re.sub(r"\n\s*", "", m[1])) | |
ret = "" | |
for a, r in zip(n, p): | |
pyperclip.copy(a) | |
sleep(0.1) | |
pyperclip.copy(r) | |
sleep(0.1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment