csv python file not saving in individual line
<ol>
<li><p>The code is working but the URLs saved are being saved in a single line rather than a different line.</p>

<pre><code>from bs4 import BeautifulSoup
import urllib2
import requests
import csv
import re

page=requests.get("https://www.tutorialspoint.com/python/dictionary_values.htm")

data=BeautifulSoup(page.content)

csv1=open("123.csv","wb+")

for link in data.find_all('a'):
    print(link.get('href'))
    csv1.write(link.get('href'))



csv1.close()
</code></pre></li>
<li><p>Thanks in advance</p></li>
</ol>

<p>Instead of just <code>csv1.write</code>, use <code>csv.writer</code> modules</p>

<pre><code>from bs4 import BeautifulSoup
import urllib2
import requests
import csv
import re

page=requests.get("https://www.tutorialspoint.com/python/dictionary_values.htm")

data=BeautifulSoup(page.content)

csv1=open("123.csv","wb+")
csv1writer = csv.writer(csv1)

for link in data.find_all('a'):
    print(link.get('href'))
    csv1writer.writerow([link.get('href')])

csv1.close()
</code></pre>

python csv url beautifulsoup