Add conditions to links

Is there a way to add conditions to links? I'd like to make a scraper that follows links on a site as long as they link to the same domain.

Url: It's behind authentication

Sitemap:
{"_id":"more_nextstar","startUrl":["https://member.nexstarnetwork.com/page/1/online-training-tools.jsp?ssl=true"],"selectors":[{"id":"links","type":"SelectorLink","parentSelectors":["_root","links"],"selector":"a","multiple":true,"delay":0},{"id":"iframe src","type":"SelectorElementAttribute","parentSelectors":["_root","links"],"selector":"iframe","multiple":true,"extractAttribute":"src","delay":0}]}

Sure, just use a CSS selector option, e.g. for the standard <a> tag:

a[href^="https://www.mydomain.com"]

This means, match an <a> element whose href attribute value begins with "https://www.mydomain.com"]

Ref: CSS Selector Reference