Skip to content

Instantly share code, notes, and snippets.

@kblok
Created April 28, 2021 21:24
Show Gist options
  • Save kblok/8757d7bb80af89c41c016b913d4446dc to your computer and use it in GitHub Desktop.
Save kblok/8757d7bb80af89c41c016b913d4446dc to your computer and use it in GitHub Desktop.
fille-frame.py
import os
import json
from playwright.sync_api import sync_playwright
def run(playwright):
browser = playwright.chromium.launch(headless=False)
page = browser.new_page()
page.goto("https://cdpn.io/hardkoded/fullpage/jOyobqJ")
iframe0 = page.query_selector('#result').content_frame()
iframe1 = iframe0.query_selector('xpath=//iframe[@title="payment"]').content_frame()
iframe1.fill('//*[@id="cardCvc-input"]', '123')
iframe1.fill('//*[@id="cardCvc-input"]', '122')
with sync_playwright() as playwright:
run(playwright)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment