#108 How do I stop my browser from closing in Playwright with Python | Add breakpoint | Pause script

preview_player
Показать описание
#playwright
#pytest
Рекомендации по теме
Комментарии
Автор

please make a video how to deploy to github actions with allure reports. I think it will be very useful for us. Thanks for your lessons!!!

Vadzim-dlko
Автор

AttributeError: 'Playwright' object has no attribute 'get_by_placeholder'

when i tried to run the program it is giving like this, how do i resolve

leoprabhakar
Автор

Can you please post a video on how to pass values using a JSON file in Playwright-Python

karthikvk
Автор

No asynchronous way, the download will be very time-consuming, asynchronous how to control all files to close the browser after the download is complete. I have tried many methods, what should I do? thanks Looking forward to the answer.

import asyncio
from pathlib import Path
from playwright.async_api import async_playwright

async def main(url):
async with async_playwright() as p:
download_text = ['1GB', '2GB', '3GB', '4GB', '5GB', '6GB', '7GB']
download_dir = "/Volumes/TOSHIBA/udemy" # The path to the downloaded file
context = await
user_data_dir='./user-data',
Chrome',
headless=False,
args=['--disable-blink-features=AutomationControlled',
)
page = await asyncio.wait_for(context.new_page(), timeout=10)
await page.goto(url,

# Click on the "Download" button
for text in download_text:
await page.wait_for_selector(f":text('{text}')", timeout=30000)
download_btn = await
await download_btn.click()

await asyncio.sleep(2)
# Wait for the file to finish downloading
downloading = True
while downloading:
await asyncio.sleep(3)
downloading = await page.evaluate('''() => {
let el =
if (el && el.style.display === 'none') {
return false
} else {
return true
}
}''')
print(f'{download_text} is downloading...')

print(f'{download_text} is downloaded successfully.')

# Close the browser
await context.close()

url = "www.google.com"
asyncio.run(main(url))

zhengdiao
Автор

How to find broken links in playwright

mahaboobsabmaniyar