New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] Extract html attribute and make it available as a token for notification #2254
Comments
Yes - I was thinking that you should be able to query the HTML in the "notification body" since it can also use Jinja2 templating for example - the template could be
|
It should save the HTML on each fetch too |
Saw this as well as a reddit post but still new to how you would use the jinja templates from the crawled elements or multiple elements to display in a notification. Could we have a wiki article to document how this would work? |
Id potentially be interested enough in this to contribute to the fix if its something that's within the realm of what a new contributor could add. dgtlmoon: if you have time, could you maybe let me know if you think this could be doable for a new-to-this-codebase contributor with fairly strong general knowledge of python (and programming in general)? Would be helpful to have a general roadmap of what you think might need changing in what parts of the codebase to help me get started (if you think its doable)? |
You can turn on the "Render anchor tag content" option which has been there since the start or use |
@dgtlmoon yes was able to achieve what I wanted with that. Trigger the notification on However, extracting the href value is a bit tricky. It worked in my case since I know the last character is always going to be a digit, so I used this regex in my filter to extract the value |
Version and OS
0.45.16 on Debian 12 (LXC in Proxmox)
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
When a change is detected, retrieve a specific attribute value given the xpath of the HTML element. Make this value accessible as a token to include in the body of a notification.
Describe the use-case and give concrete real-world examples
I'm trying to know when a lottery opens, based on the "See products" span element. This already works. The feature I would like is to extract the
href
value (/en/new-products/march-2024) of the parenta
element and embed it in the notification. This would save me a few clicks by accessing the link directly in the notification.taken from here
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: