Closed zw963 closed 2 years ago
@zw963 try to play with env var FERRUM_INTERMITTENT_SLEEP
https://github.com/rubycdp/ferrum/blob/006c5fc385596c218402de8b0d24dbe6739f1c72/lib/ferrum/frame/runtime.rb#L17
Could not find node with given id (Ferrum::NodeNotFoundError)
I never use id in #css method anyway
Note that this is not referring to a CSS #id
, but instead an ID for the object in CDP. I'll probably misspeak some terminology here, but basically each reference to something in CDP has an ID that Ferrum will communicate back and forth with. Sometimes an object in the browser changes, and that ID is no longer valid, such as on a DOM change. You have the page.network.wait_for_idle
which should help with that, but there might be more to it.
I set FERRUM_INTERMITTENT_SLEEP for 0.5 on my production, let me test for a while if it works.
It seem like works, thank you.
I use one line code like this:
ipo_question = page.css('h3.question').find {|x| x.text.match?(/When did .* IPO/i) }
It frequently get following error: (but not always)
I never use id in #css method anyway, when i try to reproduce this issue with some scrap code.
page.css('aaaaaaaaaaa')
, it never raise this error, just return a empty array.So, it is a little wired for this research this issue ...
Following is my code sample: