rubycdp / ferrum

Headless Chrome Ruby API
https://ferrum.rubycdp.com
MIT License
1.71k stars 123 forks source link

Visit a site works on chrome well, but not work on chromeless.(most of time) #227

Closed zw963 closed 2 years ago

zw963 commented 2 years ago

Following is example code, it should pop up a model dialog for user input user and password.

    instance.goto 'https://ucenter.jin10.com'

    while not (
      (form=instance.at_css('#J_loginForm')) &&
        (login=form.at_css('#J_loginPhone')) &&
        login.focusable?
    )
      puts 'waiting'
      sleep 5
    end

It works when test with chrome NON headless, but after switch to chrome headless, it almost not working because keep loop and sleep for waiting.

Can you reproduce on this site? thank you.

zw963 commented 2 years ago

Sorry, maybe network issue, close for now.