2023-07-01から1ヶ月間の記事一覧

CyberAgent AI

speakerdeck.com speakerdeck.com www.figma.com py4etrics.github.io

月日を年月日に変換

dt_now = pd.Timestamp.now(tz="Asia/Tokyo").tz_localize(None) df = pd.read_csv(url, parse_dates=True, index_col=0, date_parser=lambda x: datetime.datetime.strptime(x, "%m/%d").replace(year=dt_now.year)) df = pd.read_csv(url, parse_dates=Tru…

url抽出

parsed_url = urlparse(url) parsed_url.path.split("/")[-1] urlunparse(parsed_url._replace(query=""))

playwrightで次へをクリック

from playwright.sync_api import TimeoutError as PlaywrightTimeoutError from playwright.sync_api import sync_playwright # 「次へ」をクリック def fetch_html(url, id, parser="html.parser"): with sync_playwright() as p: browser = p.chromium.la…