'How can I find paths recursively to a site on a website?

I am trying to find a possible path from site-starting-point to a given site. One can simply think of it as: Start at site-starting-point and go recursively with infinite depth until you find site X. Another solution that would be fine with me is if it does this for every possible site and I can search through it afterwards. In theory wget -r website must do something like that internally. Is there a way to access this data so I can avoid writing my own script?

For example:

answer -site-starting-point https://wiki.archiveteam.org/index.php/Wget_with_WARC_output -site-end-point https://wiki.archiveteam.org/index.php?title=Special:WhatLinksHere/Wget_with_WARC_output&hidelinks=1&hidetrans=1

would return something like:

Endpoint is reached over:
https://wiki.archiveteam.org/index.php/Wget_with_WARC_output
>https://wiki.archiveteam.org/index.php?title=Wget_with_WARC_output&action=info
>https://wiki.archiveteam.org/index.php?title=Special:WhatLinksHere/Wget_with_WARC_output&hidelinks=1&hidetrans=1


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source