[Python] Playwright scraper API running perfectly locally but timing out when running on VPS

Discussão em 'Python' iniciado por Stack, Março 6, 2025.

  1. Stack

    Stack Membro Participativo

    As the title says, i made a playwright scraper in python that i deploy as an API using fastAPI and gunicorn, this works super well locally and runs in about 1-3 seconds. however when i run it on my dedicated VPS, it only has 2 vCPUs but it times out at about 40% load so i doubt thats the issue, it seems to be getting stuck on finding the first button and i cannot figure out why.

    error message: {"error":"Cookies button not found","details":"Page.wait_for_selector: Timeout 5000ms exceeded.\nCall log:\n - waiting for locator("[class=\"ui-btn ui-btn--primary ui-btn--block@screen-small\"]") to be visible\n"}

    Posting the repository below, the program in question is "mainPlay.py"

    https://github.com/NordinCoding/fastAPI

    Continue reading...

Compartilhe esta Página