a bytes-like object is required, not 'str' (python)
<p>I'm a beginner in python and I'm getting the following error message</p>

<blockquote>
  <p>a bytes-like object is required, not 'str'</p>
</blockquote>

<p>This is my code:</p>

<pre><code>data = urllib2.urlopen(target_url)

xList = []
labels = []
for line in data:
    row = line.strip().split(",")
</code></pre>

<p>anyone can help me.   thanks</p>