Linked Questions

Popular Questions

blank list error when taking data from web site

Asked by At

I have a problem on API. Its turns to me empty list

I tried to search browser but none is my answer.

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import urllib import re

site = "" 
regex = "<span class='news-title'>(.+?)</span>" 
comp = re.compile(regex) 
print(comp) print(regex) 
htmlkod = urllib.urlopen(site).read() 
titles = re.findall(regex, htmlkod) 
for title in titles:
        print str(i), title.decode("iso8859-9")

I Expect the its turn to me news titles but its turn me "[]" empty list

Related Questions