Scan URL and retreive subfolder name

Is there a way to scan/analyse a URL Ex: www.test.com and retrieve all subfolder names (underneath the root)?

Can’t find anything related to this and seems basic… any tips?