I am using Selenium 4 with Ruby and I'm trying to capture the Network activity, but I can't figure out how to use the libraries and haven't found anything related to this for Ruby.
So what I did is:
- I added the DevTool gem in the Gemfile:
gem 'selenium-devtools', '~> 0.91.1'
- I the code I'm trying this:
devtools = browser.devtools
network = Selenium::DevTools::V91::Network.new(devtools)
network.enable
but it doesn't seem to work.
When debugging I see something strange: on creating the DevTools object there seems to be an exception at the socket
method:
Unfortunately I can't figure out why this happens and didn't find anything about this. I tried to force into the .new
method which fails somewhere but it doesn't take me anywhere.
Have you stumbled upon something similar or does anyone have some advice on how to properly use the DevTools in Ruby?