# selectorAll

Type:

\<string\> \| \<string\[\]\>

\
Values: [CSS selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors)

It's the same as [selector](https://microlink.io/docs/sdk/methods/extract/selector) but it returns a collection of results, being equivalent to [Document.querySelectorAll()](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll):

```js
importcreateClientfrom'microlink.io'

constmicrolink=createClient()

consthackerNews=()=>

microlink.extract('https://news.ycombinator.com/',{

posts:{

selectorAll:'.athing',

attr:{

title:{

type:'title',

selector:'.titleline > a',

attr:'text'

},

url:{

type:'url',

selector:'.titleline > a',

attr:'href'

}

}

}

})

const{posts}=awaithackerNews()

console.log('latest hacker news posts:',posts)
```

Without a nested `attr`, each match contributes one plain value, which is how [links](https://microlink.io/docs/sdk/methods/links) and the other sweep methods work:

```js
const{links}=awaitmicrolink.extract('https://news.ycombinator.com/',{

links:{

selectorAll:'.titleline > a',

attr:'href',

type:'url'

}

})

console.log(links)// => ['https://…', 'https://…', …]
```