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

fix: correctly set cookies #185

Merged
merged 2 commits into from
Jan 23, 2025
Merged

fix: correctly set cookies #185

merged 2 commits into from
Jan 23, 2025

Conversation

ZephyrZenn
Copy link
Contributor

@ZephyrZenn ZephyrZenn commented Jan 15, 2025

PR Description

Summary

This pull request introduces the changes to crawl function. This fix the problem that crawler can't get cookies correctly.

Changes Made

  1. Update PlaywrightCrawler.preNavigationHooks in crawl function(core.ts)
    • setting cookies before return if RESOURCE_EXCLUSIONS is empty. Otherwise cookies won't be set if no url excluded.
    • Use request.url instead of request.loadedUrl as cookie's url. Crawler hasn't naviagetd to the page when the hook invoked, so the loadedUrl would always be undefined.

Impact

Crawler can use cookies correctly when there is no excluded urls.

@steve8708
Copy link
Contributor

thanks @ZephyrZenn !

@steve8708 steve8708 merged commit 50f85a3 into BuilderIO:main Jan 23, 2025
5 checks passed
Copy link

🎉 This PR is included in version 1.5.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants