Recipes
Recipes for what pages usually ask of a visitor, built from actions. Each one runs the same with or without a browser, on every engine and driver, and gives the same data. Each recipe is tested that way. When a step can only be done with JavaScript, the recipe says so.
Try each one as it is, then add "browser": true (or "browser": "camoufox"…) to its options: the data doesn't change.
Go through pages
Click "Next" as many times as needed. Without a browser, the link is followed:
Actions
Data
To collect every page rather than only the last one, use steps, one per page.
Load more
Many "Load more" buttons add items without leaving the page, but are links underneath. With a browser, the script appends the items; without one, the link leads to the page that has them all. Wait for the last expected item, so a browser doesn't extract before they arrive:
Actions
Data
Accept a cookie banner
Make the click optional: the banner may not show, for instance when the session has already accepted it. The choice is a cookie, so it's kept for the next pages, and by sessions for the next requests:
Actions
Data
#consent is null: the banner is gone.
Fill in and submit a form
Text fields, menus and checkboxes, then the submit button. Hidden fields, such as security tokens, are sent with the rest:
Actions
Data
select takes an option's value or its visible text.
Search with the Enter key
type enters the text key by key, like a person; press on the field submits its form:
Actions
Data
Go to another page, then wait
navigate loads another address on the same site; wait_for waits until what you need is there:
Actions
Data
Buttons that only work with JavaScript
Some buttons have no link or form behind them. With a browser, they work; without one, the click is skipped, the request still succeeds, and actions and warnings say what didn't run:
Actions
Data
Infinite scroll
Scroll to the bottom as many times as it takes, leaving the page time to load (delay, in milliseconds). Only a browser can scroll; without one, you get the first posts:
Actions
Data
Run your own script
evaluate runs JavaScript in the page and reports what it returns, to read a value or prepare the page. It needs a browser:
Actions
Data
Log in
A login form is a form: fill in and submit. Many need JavaScript, so log in with a browser, then scrape without one. Sessions and steps show how.