from urllib.request import urlopen from bs4 import BeautifulSoup import ssl # Ignoruj błędy związane z certyfikatami SSL ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE url = input('Podaj link - ') html = urlopen(url, context=ctx).read() soup = BeautifulSoup(html, "html.parser") # Pobierz wszystkie znaczniki hiperłączy tags = soup('a') for tag in tags: # Przejrzyj elementy związane ze znacznikiem print('TAG:', tag) print('URL:', tag.get('href', None)) print('Contents:', tag.contents[0]) print('Attrs:', tag.attrs)