All pastes #441284 Raw Edit

Miscellany

public python v1 · immutable
·published 2007-04-15 16:37 UTC
rendered paste body
# -*- coding: utf-8 -*-import urllib2, htmldataurl="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 = falsefor 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