-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
Is it possible to configure this with a remote service like Browserless.io? #216
Comments
@jklina There's |
Thanks for the tip! I had tried that, but I think it expects an
It looks like the library uses an |
Oh I'm afraid that it currently is not possible because we expect url for the browser rather than ws. Take a look at https://github.com/rubycdp/ferrum/blob/master/lib/ferrum/browser/process.rb#L67 I think we might also accept ws_url. Just try to fix it locally and if it works we can merge a PR |
We were able to use remote Chrome in a separate Docker container (from Browserless' images) with Cuprite by passing the URL in to the |
It looks like this might be possible via this section that mentions via host and port in their documentation, I don't currently use Browserless though. |
I was also using capybara + cuprite + ferrum with browserless.io docker image. It worked, just had to specify browser url for ferrum (cuprite) driver. |
Self-hosted docker images from Browserless do not experience the problem the OP is describing. I spent some time on this today and found myself out of my depth, but here's what I know:
I tried hacking something together but this is out of my nerd comfort zone. Hope this helps someone else figure it out. |
I'll implement this when I find time, but the main issue now is that browserless uses only one connection, but ferrum uses many (one per browser and one per page) which seemed as a good design decision to me at the moment and even now. |
For now I'm just managing my own lil Chrome services, but I will definitely appreciate it when I can turn an infrastructure problem into a money problem. Ferrum already simplifies things plenty by letting me skip Puppetteer. I appreciate y'alls work. |
First of all thanks to @route for this amazing library, i'vve been using it for years and the api is great. I have come to this issue after trying to connect ferrum with a chrome instance provided by a third-party provider (Brighdata 'Scraping Browser' product) I have modified some methods to include basic authentication in the first communication with the browser (json/version) and add OpenSSL socket to open a connection with their websockers (I don't know why the TCP connection did not work). After getting the WebSockets connection working, it returns an exception when trying to enable the page (by calling the "Page.enable" method) I have tried to compare the commands that puppeteer sends via WebSockets and I have tried to patch the ferrum code to call the same methods in the same order (using sessionId in addition to contextId and targetId), but also when calling "Page.enable", the call times out and raises DeadBrowserError exception. I would love to understand how ferrum uses many connections to try to work with third party providers, I could even take charge of developing it and add a pull request, but I am lost on how to do this. |
@borlafdev I think the difference is that for every page Ferrum opens up a new connection, which is not the case for Puppeteer. To multiplex and use the same WebSocket they used to call something like sendMessageToTarget https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-sendMessageToTarget which is now deprecated.
I think this is due to the page not being available on the websocket because it's behind the service. |
Is this still the case? I am struggling to get Ferrum to pass on the query/url params, it seems to be stripping them..? |
Same problem here, passing proxy url is working for connections to browserless through devtools, but not working through ferrum. |
Guys you could have provided version at least, and a script you are running. That would be more helpful than +1 |
Hey @route , First of all thank you for all the work. Secondly, I have created this example project which reproduces the error. after cloning, you can |
@PabloScolpino awesome thanks I'll take a look. WIll keep it open for now. |
latest cuprite doesn't depend on the latest ferrum, and I believe this is fixed in latest Ferrum. |
I was curious if it was possible to configure the protocol to work with a remote service rather than a local instance of Chrome. Thanks so much!
The text was updated successfully, but these errors were encountered: