-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
How to make Prefect work with Headless Selenium? #3609
Comments
I ran into this issue the other day, Dylan helped me out on the Slack channel. I defined a local storage and set
|
@lejimmy thank you so much for helping me out on that :) Works like a charm! Only thing I noticed is that when I split the tasks up into modules and import functions that I get the same error. So for now I guess I have to all tasks with returned driver objects in one file? Or did you also by any chance face this issue? :) |
That’s what I’ve been doing. Maybe saving your cookies can help you bypass some steps once you’ve already authenticated: https://stackoverflow.com/a/48665557 |
Answer here and in Slack thread: https://prefect-community.slack.com/archives/CL09KU1K7/p1603318809428700 |
Archived the thread here for better discoverability: #3669 |
Description
I want to use Prefect for some automated scraping of my own social media stats such as posts, profile views on LinkedIn for example. With a lot of javascript and logging in, headless Selenium is the easiest solution so far.
When I run my code inside the file with
flow.run()
everything works out perfectly.Registering the flow also works, but when I execute it in a local environment, the logs show following issue:
I believe the issue is that I am passing the driver object from one task to the next. However the selenium driver object cannot be pickled as the logs indicate.
Is there any way I can prevent serialising the driver object, and still use the driver (authenticated session) in other tasks? Or what would be a potential work around to make this work?
Expected Behavior
When running the following flow/task in the UI I would expect to not see any issues as when I execute
flow.run()
:Here's my flow:
Environment
Very much appreciate your help!
Thanks, Felix
The text was updated successfully, but these errors were encountered: