from bs4 import BeautifulSoup
import urllib.request
from urllib.parse import urlparse
resp = urllib.request.urlopen("https://toster.ru")
soup = BeautifulSoup(resp, from_encoding=resp.info().get_param('charset'))
for link in soup.find_all('a', href=True):
href = link['href']
if not urlparse(href).netloc or 'toster.ru' in href:
print(href)