twalpole / apparition

Capybara driver for Chrome using CDP
MIT License
363 stars 46 forks source link

DOMException: Failed to execute 'querySelectorAll' on 'Element': The provided selector is empty. #83

Open rosenfeld opened 3 years ago

rosenfeld commented 3 years ago

Hi, I've been using Poltergeist for a long time in a monitoring project and now I noticed it's time to upgrade it. I was trying apparition, but after installing Chrome and following the instructions, I tried to play with it and got this error:

# Gemfile
source "https://rubygems.org"
gem 'apparition', github: 'twalpole/apparition'
gem 'capybara'

# test.rb
require 'capybara/dsl'
require 'capybara/apparition'
Capybara.default_driver = :apparition

Capybara.register_driver :apparition do |app|
  Capybara::Apparition::Driver.new(app, browser_options:
    { 'no-sandbox' => nil, 'disable-web-security' => nil,
      'disable-features' => 'VizDisplayComposito' })
end

class Session
  include Capybara::DSL
end

session = Session.new
session.visit 'https://www.google.com'
session.page.find('body').first # calling first triggers the error

Am I doing something wrong?