'Loop for urlparse

I am a beginner with python and I'm having a problem with loops. I need to do a loop from a url list that I got from google search import in python:

#import requests
from googlesearch import search
import urllib.parse
    
# search in google
palavra_chave = 'site:com.br intext:"hotel" inurl:wp-content/'
    
try:
  print("Searching...")
  for j in search(palavra_chave, num=3, stop=3, pause=4):
    print(j)
except ImportError:
  print('Connection error with Google Database!')
    
# filter here (shows just url.com.br)
    
for i in j:
  url_parts = urllib.parse.urlparse(i)
  result = '{uri.scheme}://{uri.netloc}/'.format(uri=url_parts)
  print(result)

The result is like this:

Searching...
https://site.com.br/hotel/wp-content/uploads/
http://site.com.br/wp-content/uploads/
https://site.br/wp-content/uploads/2020
:///
:///
:///
:///
:///
:///
:///
:///
:///
:///

I need to filter each url separately



Sources

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

Source: Stack Overflow

Solution Source