Hi Team,
I need help,
Download works but 10 times is same (first) file downloaded.
what i am doing wrang in code?
tnx
here is code:
`from playwright.sync_api import sync_playwright
import base64
import sys
import time
def run(playwright):
browser = playwright.chromium.launch(headless=False)
context = browser.new_context(accept_downloads=True)
df3 = pd.DataFrame()
# Open new page
page = context.new_page()
page.goto(
"https://file-examples.com/index.php/sample-documents-download/sample-xls-download/")
cookies = context.cookies()
# print("Coockies", cookies)
handles = page.query_selector_all("#table-files .file-link")
for x in handles:
with page.expect_download() as download_info:
page.click("a.btn")
download = download_info.value
print(download)
path = download.path()
print(path)
page.close()
---------------------
context.close()
browser.close()
with sync_playwright() as playwright:
run(playwright)
`
Hi Team,
I need help,
Download works but 10 times is same (first) file downloaded.
what i am doing wrang in code?
tnx
here is code:
`from playwright.sync_api import sync_playwright
import base64
import sys
import time
def run(playwright):
browser = playwright.chromium.launch(headless=False)
context = browser.new_context(accept_downloads=True)
df3 = pd.DataFrame()
---------------------
with sync_playwright() as playwright:
run(playwright)
`