# -*- coding: utf-8 -*- import urllib2, htmldata url="http://www.milliyet.com.tr/2007/04/15/yazar/" url1 = 'http://www.milliyet.com.tr/2007/04/15/yazar/altan.html' contents = urllib2.urlopen(url1).read() L = htmldata.tagextract(contents) yazar=[] alalim = false for i in range(len(L)): if str(L[i]) == "('!-- PRINT BASLADI --', {})": alalim = true if str(L[j]) == "('!-- PRINT B\xddTT\xdd --', {})": alalim = false break if alalim == true: yazar.append(L[i]) print yazar