Re: Program inefficiency?
- From: George Sakkis <george.sakkis@xxxxxxxxx>
- Date: Sat, 29 Sep 2007 22:53:07 -0000
On Sep 29, 2:32 pm, hall.j...@xxxxxxxxx wrote:
It think he's saying it should look like this:
(line noise snipped)
Or you can let BeautifulSoup do the dirty job for you and forget all
this ugliness:
from BeautifulSoup import BeautifulSoup
soup = BeautifulSoup(text)
for a in soup.findAll('a'):
for attr in 'href','name':
val = a.get(attr)
if val:
a[attr] = val.replace(' ','_')
print soup
George
.
- References:
- Program inefficiency?
- From: hall . jeff
- Re: Program inefficiency?
- From: thebjorn
- Re: Program inefficiency?
- From: Pablo Ziliani
- Re: Program inefficiency?
- From: hall . jeff
- Re: Program inefficiency?
- From: hall . jeff
- Program inefficiency?
- Prev by Date: Re: Command-line does work when scheduled
- Next by Date: What's the current status of socket timeouts?
- Previous by thread: Re: Program inefficiency?
- Next by thread: RE: Program inefficiency?
- Index(es):
Relevant Pages
|