WindmillWWindmill
Powered by
joetongJ
Windmill•2y ago•
5 replies
joetong

playwright chromium could not be successfully closed

def run(playwright, url: str, doc: dict, proxy):
browser = None
try:
browser = playwright.chromium.launch(proxy=proxy)
context = browser.new_context()
context.set_default_navigation_timeout(600000)

# 拦截请求
def block_images_and_css(route, request):
if request.resourcetype in ["image", "stylesheet", "script"]:
route.abort()
else:
route.continue
()

context.route("*/", block_images_and_css)
page = context.new_page()

page.goto(url)
page.evaluate("window.scrollTo(0, document.body.scrollHeight)")
page.wait_for_load_state("domcontentloaded")
except Exception as e:
print(f"An error occurred: {e}")
finally:
if browser:
browser.close()
WindmillJoin
3,362Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?
Recent Announcements
henri-c

Weekly kenote to tell you about our latest updates https://discord.com/channels/930051556043276338/1278977038430240813 https://youtube.com/live/2dGd9TdT8xs?feature=share

henri-c · 4d ago

Pyra

### HTTP tracing (EE) Capture HTTP requests made by job scripts as observability spans Features: - View HTTP request traces (method, URL, status, timing) in the job details UI - Auto-instrumentation for Native TypeScript, MITM proxy for other languages - Integrates with external OpenTelemetry collectors changelog: https://www.windmill.dev/changelog/http-tracing docs: https://www.windmill.dev/docs/advanced/instance_settings#http-tracing Additionally jobs memory metrics are now fully OSS!

Pyra · 2w ago

henri-c

First keynote of the year here https://discord.com/channels/930051556043276338/1278977038430240813 🙂

henri-c · 4w ago

Similar Threads

Running scheduled reports - chromium not working
saraf0509Ssaraf0509 / help
2y ago
The flow could not be saved - Flow version not found
MrOsdevMMrOsdev / help
14mo ago
Init script playwright
EnterEEnter / help
2y ago