You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

12 lines
301 B

from urllib.parse import urlparse
def clean_articles(rows):
#article_id, url, title, byline
out = []
for row in rows:
parsed_uri = urlparse(row[1])
result = '{uri.netloc}'.format(uri=parsed_uri)
out.append([row[0], row[1], row[2], row[3], result])
return out