Products:
News
Contact
German Website
Home Features Screenshots Videos Downloads Shop Knowledgebase


Search Knowledgebase:

 

Alert when a page adds an out-of-stock image

User question:

> I want to get a notification when a product becomes out of stock. The page

> just puts an image on the page without a text change, so WebSite-

> Watcher is not able to find that change.

 

Best way to detect such a change is to write a private plugin that replaces the HTML tag with that image with an appropriate text.

 

For example, if the image is displayed with the HTML tag <img src="oos.png">, you can use the event function Wsw_PreProcessPage and replace that tag with a text.

 

The event function Wsw_PreProcessPage is called after the page has been downloaded and before the source is processed by WebSite-Watcher.

 

You can use this code as starting point:

 

Sub Wsw_PreprocessPage(ByRef $sMem, ByRef $sStatusMessage, ByRef $iStatusCode)
   
   $sMem = Replace($sMem, "<img src=""oos.png"">", "OUT-OF-STOCK")
   
End Sub

 

 

UPDATE (solution without plugin)

 

Starting with WebSite-Watcher 2019, there is a new option "Extract image addresses".

 

This option can be used to insert the image addresses into the page, no plugin is required in that case. Image addresses will be inserted between [img] and [/img] what makes it sometimes easier to create appropriate filters.

 

out-of-stock-image