rsspls icon indicating copy to clipboard operation
rsspls copied to clipboard

"element selected as link has no 'href' attribute" when not using any link

Open mach-o opened this issue 1 year ago • 2 comments

I'm getting the following error:

ERROR rsspls::feed > unable to process RSS item matching 'data'

Caused by:
    element selected as link has no 'href' attribute

When I don't actually use the link element. I just have this in feeds.toml:

[[feed]]
title = "JEWISH NATIONAL FUND v. MINISTER OF NATIONAL REVENUE A-245-24"
filename = "JNFvMNR.rss"
user_agent = "Mozilla/5.0"
[feed.config]
url = "file://[local path redacted]/A-245-24.xml"
item = "data"
heading = "RECORDED_ENTRY"
summary = "DOCNO"
date = "FILING_DATE"

So I'm a bit confused as to why it's searching for a link. Though it is true there are no hrefs anywhere in the source xml file.

For reference, this flows from the same situation described in issue 61

mach-o avatar Dec 20 '24 15:12 mach-o

For completeness, I should say I also have this in the feeds.toml, I just omitted it for brevity:

[rsspls]
# output directory to write the feeds to
output = "[local path]"
file_urls = true # to allow reading from files

mach-o avatar Dec 20 '24 15:12 mach-o

rsspls currently requires a link element. There is fallback behaviour for compatibility with older versions if link is not specified. The docs have more details: https://rsspls.7bit.org/documentation/#feed-config-link

It seems like link is not required in an RSS feed so I think the requirement for one could be relaxed.

wezm avatar Dec 24 '24 06:12 wezm

It seems like link is not required in an RSS feed so I think the requirement for one could be relaxed.

I've looked into this and decided not to proceed. Each item in the feed needs a stable GUID. At the moment the link href is used for this. To support items without links some way to assign guid to item that's stable across invocations would need to be determined. One option would be to generate a uuid, but supporting this would require preserving these uuids across invocations, which complicates matters.

wezm avatar Oct 04 '25 04:10 wezm