Dup Ver Goto 📝

selecting-links-1

PT2/snippets/js does not exist
To
23 lines, 75 words, 672 chars Page 'selecting-links-1' does not exist.

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"))