4 ms·
This is a nice and interesting project! Obviously, I had to do it for HN: { page(url:"https://news.ycombinator.com") { items: query(selector
by flaie 11y ago
This is a nice and interesting project!
Obviously, I had to do it for HN:
{
page(url:"https://news.ycombinator.com") {
items: query(selector:"tr.athing") {
rank: text(selector:"td span.rank")
title: text(selector:"td.title a")
site: text(selector:"span.comhead a")
url: attr(selector:"td.title a", name:"href")
attrs: next {
score: text(selector:"span.score")
user: text(selector:"a:eq(0)")
comments: text(selector:"a:eq(2)")
}
}
}
}
In order to do that, I had to fork to add the support for "next" which will retrieve the immediately following sibling (ala jQuery), due to how HN is structured as table rows.
- syrusakbary 11y agoMakes sense! Merging soon :)