@@ -0,0 +1,1727 @@
+import requests%0Afrom bs4 import BeautifulSoup%0A%0A%0Adef clean_links(links):%0A    results = %5B%5D%0A    for link in links:%0A        hashIndex = link.find('#')%0A        if hashIndex %3E -1:%0A            link = link%5B:hashIndex%5D%0A        queryStringIndex = link.find('?')%0A        if queryStringIndex %3E -1:%0A            link = link%5B:queryStringIndex%5D%0A        if len(link) %3E 0 and link != '/':%0A            results.append(link)%0A    return sorted(list(set(results)))%0A%0A%0Adef get_links(a_elements):%0A    links = %5Blink.get('href')%0A             for link in a_elements if link.get('href') != None and link.get('href') != ''%5D%0A    links_internal = clean_links(%5Bl for l in links if l%5B0%5D != 'h'%5D)%0A    links_external = clean_links(%5Bl for l in links if l%5B0%5D == 'h'%5D)%0A    return links_internal, links_external%0A%0A%0Adef print_links(links):%0A    for link in links:%0A        print(link)%0A%0A%0Adef run(url):%0A    response = requests.get(url)%0A    soup = BeautifulSoup(response.content, 'html.parser')%0A    a_elements = soup.find_all('a')%0A    links_internal, links_external = get_links(a_elements)%0A%0A    print('-' * 100)%0A    print(f'URL: %7Burl%7D')%0A    print()%0A    print(f'INTERNAL: %7Blen(links_internal)%7D')%0A    print_links(links_internal)%0A    print()%0A    print(f'EXTERNAL: %7Blen(links_external)%7D')%0A    print_links(links_external)%0A    print()%0A    print()%0A%0A%0Aif __name__ == %22__main__%22:%0A    urls = %5B%0A        'https://www.python.org/',%0A        'https://www.datacamp.com/',%0A        'https://realpython.com/',%0A        'https://reactjs.org',%0A        'https://graphql.org',%0A        'https://apollographql.com',%0A        'https://principledgraphql.com',%0A        'https://twitter.com',%0A        'https://www.instagram.com/',%0A        'https://facebook.com',%0A    %5D%0A    for url in urls:%0A        run(url)%0A

Add scraping to pratice