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"}]}