need help with PyXML

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Hahn

    need help with PyXML

    I am trying to parse HTML for the first time. I first installed
    4Suite-1.0a3.win32-py2.3.exe and then realized I didn't need it. Then I
    installed PyXML-0.8.3.win32-py2.3.exe. Now when I try to execute this as
    the first line of my module ...

    from xml.dom.ext.rea der import Sax2

    .... I get this Exception ...

    Sequence index out of range: list index out of range

    Traceback (innermost last):

    File "<string>", line 1, in ?

    File "c:\codeshare\c odeshare.py", line 4, in ?
    from xml.dom.ext.rea der import Sax2
    File "C:\Python23\Li b\site-packages\_xmlpl us\dom\__init__ .py", line 223, in
    ?
    from xml.dom.html import HTMLDOMImplemen tation
    File "C:\Python23\Li b\site-packages\_xmlpl us\dom\html\__i nit__.py", line
    445, in ?
    g_numCharEntity Pattern = re.compile('&#( \d+);')
    File "C:\Python23\Li b\sre.py", line 179, in compile
    return _compile(patter n, flags)
    File "C:\Python23\Li b\sre.py", line 227, in _compile
    p = sre_compile.com pile(pattern, flags)
    File "C:\Python23\Li b\sre_compile.p y", line 469, in compile
    code = _code(p, flags)
    File "C:\Python23\Li b\sre_compile.p y", line 453, in _code
    _compile(code, p.data, flags)
    File "C:\Python23\Li b\sre_compile.p y", line 88, in _compile
    _compile(code, av[1], flags)
    File "C:\Python23\Li b\sre_compile.p y", line 69, in _compile
    _compile(code, av[2], flags)
    File "C:\Python23\Li b\sre_compile.p y", line 27, in _compile
    for op, av in pattern:
    File "C:\Python23\Li b\sre_parse.py" , line 138, in __getitem__
    return self.data[index]


  • Mark Hahn

    #2
    Re: need help with PyXML

    Note: I just found a thread from over a year ago where someone else
    reported the same bug. Can someone give me a hint on how to work around
    this bug?

    previous thread: http://tinyurl.com/p8xj

    "Mark Hahn" <mark@hahnca.co m> wrote in message
    news:p3oeb.4606 $hp5.3567@fed1r ead04...[color=blue]
    > I am trying to parse HTML for the first time. I first installed
    > 4Suite-1.0a3.win32-py2.3.exe and then realized I didn't need it. Then I
    > installed PyXML-0.8.3.win32-py2.3.exe. Now when I try to execute this as
    > the first line of my module ...
    >
    > from xml.dom.ext.rea der import Sax2
    >
    > ... I get this Exception ...
    >
    > Sequence index out of range: list index out of range
    >
    > Traceback (innermost last):
    >
    > File "<string>", line 1, in ?
    >
    > File "c:\codeshare\c odeshare.py", line 4, in ?
    > from xml.dom.ext.rea der import Sax2
    > File "C:\Python23\Li b\site-packages\_xmlpl us\dom\__init__ .py", line 223,[/color]
    in[color=blue]
    > ?
    > from xml.dom.html import HTMLDOMImplemen tation
    > File "C:\Python23\Li b\site-packages\_xmlpl us\dom\html\__i nit__.py", line
    > 445, in ?
    > g_numCharEntity Pattern = re.compile('&#( \d+);')
    > File "C:\Python23\Li b\sre.py", line 179, in compile
    > return _compile(patter n, flags)
    > File "C:\Python23\Li b\sre.py", line 227, in _compile
    > p = sre_compile.com pile(pattern, flags)
    > File "C:\Python23\Li b\sre_compile.p y", line 469, in compile
    > code = _code(p, flags)
    > File "C:\Python23\Li b\sre_compile.p y", line 453, in _code
    > _compile(code, p.data, flags)
    > File "C:\Python23\Li b\sre_compile.p y", line 88, in _compile
    > _compile(code, av[1], flags)
    > File "C:\Python23\Li b\sre_compile.p y", line 69, in _compile
    > _compile(code, av[2], flags)
    > File "C:\Python23\Li b\sre_compile.p y", line 27, in _compile
    > for op, av in pattern:
    > File "C:\Python23\Li b\sre_parse.py" , line 138, in __getitem__
    > return self.data[index]
    >
    >[/color]


    Comment

    Working...