-
Notifications
You must be signed in to change notification settings - Fork 361
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
Add a method for chromium-attached browser_key #116
base: main
Are you sure you want to change the base?
Add a method for chromium-attached browser_key #116
Conversation
browser_context = await browser.new_context(**browser_args) | ||
|
||
browser_artifacts = BrowserContextFactory.build_browser_artifacts(har_path=browser_args["record_har_path"]) | ||
return browser_context, browser_artifacts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the error you get trying this out??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code generally looks correct to me (minus the if contexts
part)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resharing here:
2024-03-21T03:26:13.376947Z [info ] Creating a new page
2024-03-21T03:26:13.917403Z [info ] A new page is created
2024-03-21T03:26:13.917509Z [info ] Navigating page to https://www.finditparts.com and waiting for 3 seconds
2024-03-21T03:26:17.559109Z [info ] Successfully went to https://www.finditparts.com```
Essentially it opens the page and then just stops there.
Is there any log setting to modify to get more verbose logging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you connecting over CDP locally? If you turn headless=true does a new window actually open up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debugging playwright has definitely been a nightmare for us
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, connecting locally.
- Kill all running chromium processes
- Launch a new window by adding the
--remote-debugging-port=9222
That pointed me in the right direction. It looks like a lot of the settings needed (like har path) can't be set on an existing browser_context: https://playwright.dev/python/docs/api/class-browsercontext
Although, if I remove the check for using an existing browser context it doesn't launch at all.
This pull request is stale because it has been open for 14 days with no activity. |
@illgitthat This is a great idea -- I'd love to get this merged if you're still open to pushing it across the finish line! |
@suchintan last time I looked at this I believe it isn't possible due to the limitations in the playwright BrowserContext class needed for an existing object. |
This pull request is stale because it has been open for 14 days with no activity. |
Work in progress, sharing this in case anyone sees what I am missing.