import urllib2
from BeautifulSoup import BeautifulSoup, SoupStrainer
def gather_data_ipla():
links = []
for i in range(1, 2):
url = "http://www.ipla.tv/Film/wszystkie/" + str(i)
page = urllib2.urlopen(url)
soup = BeautifulSoup(page.read())
divResults = soup.findAll('div', {'class': "universal_page_items_list"})
lis = divResults[0].findAll('li')
for li in lis:
a = li.findAll('a')
p = li.findAll('p')
if len(a) > 0 and len(p) > 0:
links.append(
dict(address=u"http://www.ipla.tv" + a[0]['href'],
full_title=p[0].find('a').text))
return links