title: How to output list of strings into .csv-file with several columns
body: <p>I'm trying to build a scraper which puts all swedish parliament members into a .csv file with several columns.</p>
  
  <p>I've managed to get the list of names as seen below. I'm having problems with splitting the strings into last names, first names and party, and then writing a .csv file with these three columns, how do I do that?</p>
  
  <p>Code:</p>
  
  <pre><code>source = urllib.request.urlopen("https://www.riksdagen.se/sv/ledamoter- 
  partier/").read()
  soup = bs.BeautifulSoup(source, "lxml")
  
  names = soup.find_all("span", {"class": "fellow-name"})
  
  for span in soup.find_all("span", {"class": "fellow-name"}):
      cleanednames = span.text.strip()
      print(cleanednames)
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Acketoft, Tina (L)
  Adaktusson, Lars (KD)
  Ahlberg, Ann-Christin (S)
  Akhondi, Alireza (C)
  Ali-Elmi, Leila (MP)
  Alm Ericson, Janine (MP)
  ...
  </code></pre>