Website State Setup fails in some fields

Web Scraper version: current
Chrome version: current
OS: Win 11

The Website State Setup seems to work on most sites but it will fail on some sites because of pre-filled text (default text) in certain fields. For example, zipcode field may have the "10000" pre-filled and this needs to be deleted first before typing in any new text. Currently, the text input feature will just append new text to the existing. In the example above, if I want to change zipcode to 12345, it would just add to the existing which makes it 1000012345, causing an error.

So we need some kind of "clear existing text" or "delete field first" feature.

image

Hi,

Could you provide some reference URLs where this is occurring?

Thanks for checking. I've included the sitemap below. It's a grocery site where the products will change depending on the postcode (zipcode). The goal is to change the postcode to "59200". The scraper will work if I don't use the Website state setup feature, and I manually key it in. The site pre-fills another postcode which must be cleared first.

{"_id":"aeon-forum","startUrl":["https://myaeon2go.com/products/category/1259855/cereal-&-breakfast/pages/1-5"],"selectors":[{"id":"Delay","parentSelectors":["Load More"],"type":"SelectorElementClick","clickActionType":"real","clickElementSelector":"head title","clickElementUniquenessType":"uniqueText","clickType":"clickOnce","delay":1123,"discardInitialElements":"do-not-discard","multiple":false,"selector":"head title"},{"id":"Scroller","parentSelectors":["_root"],"type":"SelectorElementScroll","selector":"div > div > div > div > div:nth-child(3) > ul.g-product-list","multiple":false,"delay":2081,"elementLimit":1},{"id":"Load More","parentSelectors":["_root","Load More"],"type":"SelectorElementClick","clickActionType":"real","clickElementSelector":"div > button:contains('LOAD MORE')","clickElementUniquenessType":"uniqueText","clickType":"clickMore","delay":3522,"discardInitialElements":"do-not-discard","multiple":false,"selector":"div#page-container"},{"id":"Category","parentSelectors":["_root"],"type":"SelectorText","selector":"h1 span","multiple":false,"regex":""},{"id":"Result elements","parentSelectors":["_root"],"type":"SelectorElement","selector":"#page-content > div > div > div > div > div > div:nth-child(3) > ul.g-product-list > li[data-entity-id]","multiple":true,"scroll":false,"elementLimit":0},{"id":"Product","parentSelectors":["Result elements"],"type":"SelectorText","selector":"div div.g-brand-text","multiple":false,"regex":""},{"id":"Unit","parentSelectors":["Result elements"],"type":"SelectorText","selector":"a > div > div:has(div.g-brand-text) > div:last-of-type","multiple":false,"regex":""},{"id":"Badge","parentSelectors":["Result elements"],"type":"SelectorText","selector":"a > span","multiple":false,"regex":""},{"id":"Price","parentSelectors":["Result elements"],"type":"SelectorText","selector":"div > div:contains(\"RM\") > span:first-of-type span span","multiple":false,"regex":""},{"id":"Slash Price","parentSelectors":["Result elements"],"type":"SelectorText","selector":"div > div:contains(\"RM\") > span:nth-of-type(2) > span > span:last-of-type","multiple":false,"regex":""},{"id":"Link","parentSelectors":["Result elements"],"type":"SelectorLink","selector":"div > a","multiple":false,"linkType":"linkFromHref"}],"websiteStateSetup":{"enabled":true,"performWhenNotFoundSelector":"section#location-form div input","actions":[{"selector":"nav div span button[aria-label='Change Zipcode'] span:first-of-type","type":"click"},{"selector":"section#location-form div input","type":"textInput","value":"59200"},{"selector":"section#location-form form div:last-of-type button","type":"click"}]}}

Thank you for the details. I have added this as a feature request.

1 Like