Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add a hook to customize "wait_for_load_state" behavior #656

Open
moonk-banksalad opened this issue Sep 12, 2024 · 2 comments
Labels
stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed

Comments

@moonk-banksalad
Copy link

Is your feature request related to a problem? Please describe.
Hello, I am trying to scrap a SPA page where "domcontentloaded" or "networkidle" event does not guarantee content readiness.

Describe the solution you'd like
One solution would be adding a way to pass a hook function which gets called right after opening a web page and before getting content (https://github.com/ScrapeGraphAI/Scrapegraph-ai/blob/main/scrapegraphai/docloaders/chromium.py#L88). If the playwright.Page is passed to this hook, a caller can customize how to determine readiness of the page content.

Describe alternatives you've considered
I am currently trying to workaround this limitation by monkey patching playwright functions.

Additional context
N/A

@VinciGit00
Copy link
Collaborator

hi @moonk-banksalad,
we would be glad if you implement this feature

Copy link

dosubot bot commented Jan 9, 2025

Hi, @moonk-banksalad. I'm Dosu, and I'm helping the Scrapegraph-ai team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You suggested adding a hook function to the "wait_for_load_state" process in Playwright for better SPA content readiness management.
  • This feature would allow executing a custom function post-page load, offering more flexibility than existing events.
  • Currently, you're using a workaround by monkey patching Playwright functions.
  • @VinciGit00 supported the idea and encouraged you to implement it, which you acknowledged.

Next Steps:

  • Please let us know if this issue is still relevant to the latest version of the Scrapegraph-ai repository by commenting here.
  • If there is no further activity, this issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed
Projects
None yet
Development

No branches or pull requests

2 participants