joetong
joetong
WWindmill
Created by joetong on 9/6/2024 in #help
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()
6 replies
WWindmill
Created by joetong on 1/29/2024 in #help
No matching distribution found for execjs
I want to use PyExecJS, which refers to execjs, but I keep getting the error that the package cannot be found.
1 replies