title: How to convert a BeautifulSoup list array into a String?
body: <p>I want to extract 4 numbers from a webpage with BeautifulSoup to later save those values in one line as a String in CSV format.</p>
  
  <p>Extracting and saving the values to variables is working fine with BeautifulSoups findAll() function. The 4 values I need are within <code>&lt;p&gt;</code> tags with the css-style attribute <code>"font-size: 13pt"</code>. Those values are saved in the list array linkData[].</p>
  
  <p>I just don't know how I can save those variables in one line as a String. Right now, I am always getting line breaks, which is a problem, because I need the CSV output to be: <code>var0,var1,var2,var3</code></p>
  
  <p>Instead of: </p>
  
  <pre><code>var0
  var1
  var2
  var3
  </code></pre>
  
  <p>I have already tried several things which I added to my code below. I almost got it working with my third approach but unfortunately, the encoding seems to be wrong if I use this option.</p>
  
  <p>I need <code>987, 1002, 278, 19</code>, but the output of print() is <code>(u'\n987\n', u'\n1002\n', u'\n278\n', u'\n19\n')</code>. Is there an option to change the encoding?</p>
  
  <p>I am fairly new to BeautifulSoup so any help is highly appreciated!</p>
  
  <p>Here's my code: </p>
  
  <pre><code>from bs4 import BeautifulSoup
  import urllib2
  
  opener = urllib2.build_opener()
  opener.addheaders = [('User-Agent', 'Mozilla/5.0')]
  response = opener.open('http://www.example.com')
  
  html = response.read()
  soup = BeautifulSoup(html, 'html.parser')
  
  linkData = soup.findAll("p", {"style": "font-size: 13pt;"})
  
  var0 = linkData[0].text
  var1 = linkData[1].text
  var2 = linkData[2].text
  var3 = linkData[3].text
  
  # Approach 1: Just print variables comma-separated
  print var0, var1
  
  # Approach 2: Using join to concatenate the variables 
  linkDataList = [var0, var1, var2, var3]
  str1 = ''.join(linkDataList)
  print str1
  
  # Approach 3: Use print() function
  print(var0, var1, var2, var3)
  </code></pre>
  
  <p>Best regards!</p>