ulixee / hero

The web browser built for scraping
MIT License
657 stars 32 forks source link

findResources; Merge waitForElement with waitForState; Initiate "flow" on failed waitForState #80

Closed blakebyrnes closed 2 years ago

blakebyrnes commented 2 years ago

This PR does 3 main things: 1) FindResources is exposed to client - so you can now find resources without doing a "waitFor". It will find most recent resources "first", so you could run it twice in a row and get a new result. By default, this feature looks "since the last Http Navigation". 2) WaitForElement is now a simple waitForState handler that uses getComputedVisibility changes. This is actually slightly more efficient than waitForElement, which just looped in the dom. It now only re-checks when there are dom changes, or 2 seconds have gone by. 3) WaitForState functions that fail now invoke FlowHandlers to attempt recovery.

Chore: