dimanche 3 janvier 2016

How Do I separate Prints In Python?

So I have this code that I use to web crawl ebay just for educational purposes and it works great.

import urllib.request
from bs4 import BeautifulSoup


url = "http://ift.tt/1Otg1ZB"

site = urllib.request.urlopen(url)

soup = BeautifulSoup(site.read(), "html.parser")

listings =soup.find_all('a',class_='vip')

for listing in listings:

    print (listing['href']+","+ str(listing.string))

Now when I print it out I get this.

Is there possibly a way to add a space between each listing? Anyway thanks for the help!




Aucun commentaire:

Enregistrer un commentaire