mirat can bayrak wrote:
> bir html dosyası içerisinde bütün <href="?"> etiketindeki ? kısmını okuyup
> listelemek istiyorum nasıl yaparım?
regular expression ile. Ben aşağıdakine benzer bir kod kullanıyorum.
Deneme şansım yok, o yüzden yazım hatası olabilir:
import re
html = open('/dosya/yolu','r')
regex = re.compile(r'<href=*>')
for line in html.readlines():
line
href = re.findall(regex,line)
if href: #birşeyler buldu
for s in href:
print s
html.close()
_______________________________________________
Linux-programlama mailing list
Linux-programlama_at_liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama
Received on Sat 17 Nov 2007 - 16:41:24 EET