SelectorElementAttribute fails to return attribute value of the element selected with SelectorElement

Problem.
The challenge is that i need to get attribute value from element which i'm selecting with SelectorElement ().
But SelectorElementAttribute ignores the element itself. It just checks child elements.

I would consider selecting parent element with SelectorElement. But the problem is there's no parent element.

In other words I would like to get: comment text, comment author, comment id, parent comment id, upvotes. The problem is with comment id, parent comment id. They are attributes of

If it's a bug, maybe someone can advise a workaround? Thank you.

Url:
https://www.reddit.com/r/restaurateur/comments/1g8jicb/increase_pizza_shop_sales/

Sitemap:
{"_id":"reddit-thread-scraper","startUrl":["https://www.reddit.com/r/restaurateur/comments/1g8jicb/increase_pizza_shop_sales/"],"selectors":[{"id":"main","parentSelectors":["_root"],"type":"SelectorElement","selector":"main.main","multiple":false},{"id":"title","parentSelectors":["_root"],"type":"SelectorText","selector":"h1","multiple":false,"regex":""},{"id":"comments-container","parentSelectors":["main"],"type":"SelectorElement","selector":"shreddit-comment-tree","multiple":false},{"id":"comment-text","parentSelectors":["comment-container"],"type":"SelectorText","selector":"[slot=\"comment\"]","multiple":false,"regex":""},{"id":"author","parentSelectors":["comment-container"],"type":"SelectorElementAttribute","selector":"shreddit-comment","multiple":false,"extractAttribute":"author"},{"id":"author-link","parentSelectors":["comment-container"],"type":"SelectorElementAttribute","selector":"faceplate-tracker > a","multiple":false,"extractAttribute":"href"},{"id":"comment-container","parentSelectors":["comments-container"],"type":"SelectorElement","selector":"shreddit-comment","multiple":false},{"id":"upvotes","parentSelectors":["comment-container"],"type":"SelectorText","selector":".block:shadow-root faceplate-number","multiple":false,"regex":""},{"id":"commentid","parentSelectors":["comment-container"],"type":"SelectorElementAttribute","selector":"shreddit-comment","multiple":false,"extractAttribute":"thing-id"},{"id":"parentid","parentSelectors":["comment-container"],"type":"SelectorElementAttribute","selector":"shreddit-comment","multiple":false,"extractAttribute":"parentid"}]}

@JanAp could you please advise

@JanAp still need your help here. thank you

Hi, check if this works for you:

{"_id":"reddit-thread-scraper2","startUrl":["https://www.reddit.com/r/restaurateur/comments/1g8jicb/increase_pizza_shop_sales/"],"selectors":[{"id":"main","multiple":false,"parentSelectors":["_root"],"selector":"main.main","type":"SelectorElement"},{"id":"title","multiple":false,"parentSelectors":["_root"],"regex":"","selector":"h1","type":"SelectorText"},{"id":"comments-container","multiple":false,"parentSelectors":["main"],"selector":"shreddit-comment-tree","type":"SelectorElement"},{"id":"comment-text","multiple":false,"parentSelectors":["comment-container"],"regex":"","selector":"[slot=\"comment\"]","type":"SelectorText"},{"extractAttribute":"author","id":"author","multiple":false,"parentSelectors":["comment-container"],"selector":"_parent_","type":"SelectorElementAttribute"},{"extractAttribute":"href","id":"author-link","multiple":false,"parentSelectors":["comment-container"],"selector":"faceplate-tracker > a","type":"SelectorElementAttribute"},{"id":"comment-container","multiple":true,"parentSelectors":["comments-container"],"selector":"shreddit-comment","type":"SelectorElement"},{"id":"upvotes","multiple":false,"parentSelectors":["comment-container"],"regex":"","selector":".block:shadow-root faceplate-number","type":"SelectorText"},{"extractAttribute":"thingid","id":"commentid","multiple":false,"parentSelectors":["comment-container"],"selector":"_parent_","type":"SelectorElementAttribute"},{"extractAttribute":"parentid","id":"parentid","multiple":false,"parentSelectors":["comment-container"],"selector":"_parent_","type":"SelectorElementAttribute"}]}