I’m trying to use conditions to filter out unwanted alerts from my monitors. The monitors are following prices of some items but the issue when creating conditions is that the new text on the webpage usually contains also other unrelated numbers that are similar to the prices I’m interested in - meaning that simple “has number more/less than” -conditions don’t really help.
I understand reg ex condition is the more advanced way to filter unwanted results but the issue is that I have absolutely no experience in it. Would somebody with more knowledge be kind enough to give me example condition for the following case?
The webpage announces prices in form “€530.45 each” or “€98.20 each” (without quotation marks). I’d want to create a condition which causes prices between 50-200€ to alert. What would be the correct regular expression to achieve this?
(Also, if you can give examples for different price ranges like 29-236€ or 102-323€ so that I could learn to build these myself from the provided examples that would be greatly appreciated)
Also additional question; I tried to monitor only listings that have 2-6 units available with expression “^[2-6] Available$” (without quotation marks), but looks like also listings with 1 unit cause alerts so my filter isn’t really working. Is this because the expression itself is wrong or for the reason that other text parts of the new single-unit-listing include numbers between 2-6 which causes the false alarm?
I’m sorry for the basic level questions - if my explanations were not sufficient, please tell me and I’ll try to explain better!
Hello ajitk, thanks for the reply. The website in question creates listings, which inherently have multiple numbers (price and other details) - my monitor checks the area on the webpage where all these active listings appear, so automatically all numbers on the listings are included. I’d like to filter out listings that are too expensive for me.
A separate challenge is to monitor listings (again having multiple numbers) with more than one unit available, which I tried to achieve with “^[2-6] Available$”, but apparently things are not that simple.
Filtering a list is something we have been thinking about for some time when the website itself doesn’t offer a way to filter the search result. We don’t have an easy way to do filter lists right now.
We are making progress in this direction using data sources. It is not completely ready yet.
tracking changes to urls instead of their text in a page:
$('.table a').each((_, a) => a.textContent = a.href)
Tracking changes to a style attribute of an element:
@alvaro89glez - the solution in case of bfgmine was using the JS selector. When the list has multiple numbers, conditions can’t be used effectively. The solution is to filter the list down using JS and then monitor the content for changes.