There may be times where you have most of the CSS selectors for a particular scrape or automation figured out but you expect one or two to break over time as the website updates or some other update occurs. In these cases, the VISION assignable keyword may be what you’re interested in.
When vision is enabled and a CSS selector is not present on a page, it will use the symbol the value is ASSIGNed to to determine if there’s an interactive and visible element on the page that corresponds to the requested field.
Note: This feature is in beta.
To indicate that you’d like to use vision as a fallback for a selector not showing up on a page, assign ON to the VISION keyword.
VISION <| ON |
Below’s a code example of attempting to click on the link to our docs from our landing page with our vision fallback set to on. As you can see, the selector we’re assigning to docs points to an element that does not exist which, when this is encountered, will attempt to fulfill the action after determining if there is a visible and interactive element that corresponds to the symbol being attempted to be interacted with. Here that would mean determining a CSS selector for docs that does correctly point to the link that’d direct the page to our documentation.
VISION <| ON |
lsd <| https://lsd.so |
docs <| a.this_does_not_exist |
title_of_page <| title |
FROM lsd
|> CLICK ON docs
|> SELECT title_of_page