-
Notifications
You must be signed in to change notification settings - Fork 736
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
fix: Update click-elements.ts - fix uncaught exception issue #2794
base: master
Are you sure you want to change the base?
Conversation
If the history is empty because of a navigation (for example: clicking a link - <a href=...>), then this prevents an empty state to cause an exception on line 549 in the same function.
Hi @Gilc83 and thank you for your contribution! Could you please run |
few comments from my end:
|
Happy to help @janbuchar :) If a navigation occurs due to one of the clicks - a link, form submission etc., the loop will fail for all remaining element handlers, saying that the context has been changed.
If you ask me for my opionion, I'm using the enqueuLinks function and then immediately the enqueueLinksByClickingElements, in order to get the maximum amounts of links in the website, so I believe the second option is better. However, the temporary fix I was adding, that prevents the whole function from crashing and the current Crawlee request to fail, is essentially the first option - the clicking is ceased. So I think my fix can be applied for the short term, but navigation disabling of any kind should be considered in the future. PS |
Don't worry,
Right, would you mind opening an issue that describes the problem and the possible solution so that we can come back to it later?
Don't worry, we go through all new issues and we will eventually resolve this one, too 🙂 |
If the history is empty because of a navigation (for example: clicking a link - < a href=...>), then this prevents an empty state to cause an exception on line 549 in the same function.