My bot ran into an error while going to click a selector. The error message provided is “The selector is not valid”.
When I went to check the value in question it was listed as “Father’s Day Gift Ideas”.
I tried to validate the selector and found the single quote in “Father’s” was the culprit. The string was passed through a variable(string). My question is: How can I adjust my selector to account for scenarios, where a random value within a variable such as this, is encountered with a single quote or any other chars that disrupts the automation?
I’ve attached a screenshot of my selector. Thank you!
To answer your Question: Regex or the other above methods (escaped values / ASCII characters) should work with random/difficult values. Depends on the need really.
So, a fresh approach, lets try Regex in your selector.