-
I want to observe changes on a web page listing volumes for a certain novel but the output result when I send a notification shows trigger text from all the volume containers in the page instead of just new ones. New DOM elements are added over time and inside these elements other unrelated changes I am not interested in happen but for now this is beside the point. My use case is the following:
Fetch method is basic (plaintext). Filter is The HTML looks like this: /* Series of nested obfuscated <div> elements*/
<div class=".. novel" id="volume-1">
/* Series of nested obfuscated <div> elements*/
<h2>
<a href="#volume-3">Volume 3</a>
..
</h2>
</div>
<div class=".. novel" id="volume-2"> .. </div>
<div class=".. novel" id="volume-3"> .. </div> but the notification test returns
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
ChatGPT answer.. To achieve your goal of observing changes and triggering notifications when a new Here's the XPath expression to achieve this:
Explanation:
Usage in Your Context:
This XPath expression will help you monitor the latest volume additions and ensure that your notifications are triggered only for new |
Beta Was this translation helpful? Give feedback.
ChatGPT answer..
To achieve your goal of observing changes and triggering notifications when a new
.novel
element is added to the page, specifically extracting the text content of theh2 > a
element, you can use an XPath 2.0+ expression to identify the last.novel
element without any subsequent.novel
siblings. This will help you isolate newly added elements.Here's the XPath expression to achieve this:
Explanation:
//div[contains(@class, 'novel')]
: Selects alldiv
elements that have a class containing the word "novel".not(following-sibling::div[contains(@class, 'novel')])
: Filters t…