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.

11 lines
301 B

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