With my current script
from lxml import html
import requests
from bs4 import BeautifulSoup
import re
import csv
import itertools
r = requests.get("http://www.mediamarkt.be/mcs/productlist/_128-tot-150-cm-51-tot-59-,98952,501091.html?langId=-17")
soup = BeautifulSoup((r.content),'lxml')
links = soup.find_all("h2")
g_data = soup.find_all("div", {"class": "price small"})
for item in g_data:
prijs =[item.text.encode("utf-8") for item in g_data]
for link in links:
if "TV" in link.text:
product = [link.text.encode("utf-8").strip() for link in links if "TV" in link.text]
for item in itertools.chain(prijs + product):
print item
I'm getting a list with first all the "prijs" and below all the "products. for example: prijs prijs prijs product product product
I would like to get the following result Prijs Product
Prijs Product
Prijs Product
Thank you