> is this XML, or just something that looks a little like XML ?
Unfortunately, something that looks a little XML so I can't use a XML
parser. But the HTML parser does the job.
--
http://mail.python.org/mailman/listinfo/python-list
ditional split.
You'd find SE here: http://cheeseshop.python.org/pypi/SE/2.2%20beta
Regards
Frederic
----- Original Message -----
From: "Nico Grubert" <[EMAIL PROTECTED]>
To:
Sent: Thursday, August 31, 2006 5:44 PM
Subject: Searching a string and extract all oc
Nico Grubert wrote:
> in a text with no carriage returns I need to look for all occurancies of
> this string:
>
> ...
>
> The ... can contain different values. I need to extract the string
> between and .
is this XML, or just something that looks a little like XML ?
--
http://mail.python
> This works as long as there are no other Tags in the content
> that I parse.
Got it.
I forgot to handle the 'attrs' parameter in handle_starttag().
Changed it to:
def handle_starttag(self, tag, attrs):
if tag == 'parameter':
if attrs == [('key', 'infobox_path')]:
> Try Beautiful Soup, or if your input is simple enough, the re module.
Hi Gabriel,
I first tried "HTMLParser" and wrote this short script:
from HTMLParser import HTMLParser
from htmlentitydefs import entitydefs
class MyDocParser(HTMLParser):
def __init__(self):
self.paths = []
At Thursday 31/8/2006 12:44, Nico Grubert wrote:
in a text with no carriage returns I need to look for all occurancies of
this string:
...
Try Beautiful Soup, or if your input is simple enough, the re module.
Gabriel Genellina
Softlab SRL
Hi there,
in a text with no carriage returns I need to look for all occurancies of
this string:
...
The ... can contain different values. I need to extract the string
between and .
Example text:
This is a test. A test.
/www/mydoc1
And I need to extraxt /www/mydoc1 and /www/mydoc2 from thi