Selectors
Last updated
Was this helpful?
Last updated
Was this helpful?
Selectors allow you to identify elements on the page when extracting data or interacting with the page.
For example, if you want Browserflow to click on a certain button on the page, it needs to know which button to click. The selector button:contains("Submit")
would tell Browserflow to click on a <button>
HTML element with the text "Submit".
Ways to generate selectors:
Recording actions
Using the "Select" button
Writing your own selector
When , Browserflow will automatically generate selectors for the elements you interact with.
In the Browserflow editor, you'll find a "Select" button next to the selector field in any command that requires a selector:
Clicking the "Select" button will trigger the element picker on the current page. When you click on an element, Browserflow will automatically generate a selector for that element.
e.g. A button with the text "Submit": button:contains("Submit")
e.g. Tweets that embed an external link: [data-testid="tweet"]:has(a[href*="https://t.co/"])
In addition to all , Browserflow supports a few non-standard psuedo-selectors:
- Allows selecting an element by its text contents (case-sensitive)
- Allows selecting an element by the elements it contains