See here for q and qq
a = q("div.content")
// all site-local links
b = qq("a:not([href*='://'])",a)
bh = b.map(x => x.getAttribute("href"))
bt = b.map(x => x.textContent)
bx = b.map(x => [x.textContent,x.getAttribute("href")])
// all relative links
c = qq("a:not([href*='://']):not([href^='/'])",a)
ch = c.map(x => x.getAttribute("href"))
// restrict to subdirectories (filter out ..)
c = qq("a:not([href*='://']):not([href^='../']):not([href*='/../']):not([href$='/..'])",a)
ch = c.map(x => x.getAttribute("href"))
// all links in the same subdirectory
d = qq("a:not([href*='/'])",a)
dh = d.map(x => x.getAttribute("href"))