Beautifulsoup
http://www.crummy.com/software/BeautifulSoup/
18.11.2007 tarihinde Caglar Akyuz <caglar_at_bilkon-kontrol.com.tr> yazmış:
>
> Necmettin Begiter wrote:
> > On Saturday 17 November 2007 17:14:22 Caglar Akyuz wrote:
> >> 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()
> >
> > Peki adam olmadık bir yerde satırı böldüyse? :
> >
> > <a href=
> > "ıyk.html">şurada
> > </a>
> >
>
> Ben ilk gelen mesajdan sanki çok genel anlamda değil de, sadece özel bir
> durum için gerekli olacak bir parse işlemi istendiğini düşündüm. Bunun
> için de regular expression kullanımını örneklemek istedim. Yoksa bence
> de genel bir kullanım için hazır bir kütüphane kullanımı daha mantıklı.
>
> Caglar
> _______________________________________________
> Linux-programlama mailing list
> Linux-programlama_at_liste.linux.org.tr
> http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>
-- Yılmaz Uğurlu ~ jabber : metoikos@jabber.org ~ http://www.2nci.com ~ İzmir
_______________________________________________
Linux-programlama mailing list
Linux-programlama_at_liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama
Received on Mon 19 Nov 2007 - 11:22:26 EET