How to extract items dynamically

How can I extract items from a list or a menu with out knowing up front the item count?
For example in the drop down on this page: https://www.w3schools.com/howto/howto_css_dropdown.asp
image I would like to put Link 1, Link 2, Link 3 into an array.

Maybe sourceExtract ? Or use store Xpath count?

If I understood the manual, with sourceExtract I have to put in a regex expression. I tried with out success. The page from which I need to extract information is more complicated than the example I gave. Not being able to use xpath expression (or can we) makes be have to use capture groups in regex. If there are 50 items this would mean 50 call with the same regex requesting each captured element.
It seems that the solution will be based on executing a java script and returning the array. Still working on it.

It’s very hard to extract from select, some types of select are most complex because use html or ajax.