'How can I make a graph of a website in python?

I would like to make a python script which take as an input primary url for example: https://stackoverflow.com/ and then it goes recursivley over all the pages and make a directed graph of all the pages (nodes) of the site and its sub pages, which has an edged if and only if there is link in node a (page a) to node b (page b). I assume there is something like that but I didn't find in google... If there is any ideas, maybe using wget who something else I would love to hear.



Sources

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

Source: Stack Overflow

Solution Source