Hello,
Thanks for the reply. I tried replacing all of that syntax throughout the script, and afterwards I was getting this error instead when trying to do a document.getFirstItem() XPath lookup.
File "hello.py", line 8, in ?
test.main()
File "/home/hlcc/public_html/handl-scrape/test.py", line 18, in main
html_wrapped = "<html>" + str(document.getFirstItem('//select[@name="Page"]')) + "</html>"
File "/home/hlcc/public_html/handl-scrape/BSXPath.py", line 2627, in getFirstItem
elm=self.evaluate(expr,context,None,XPathResult.FIRST_ORDERED_NODE_TYPE,None).singleNodeValue
File "/home/hlcc/public_html/handl-scrape/BSXPath.py", line 2617, in evaluate
return self.createExpression(expr,resolver).evaluate(context,type)
File "/home/hlcc/public_html/handl-scrape/BSXPath.py", line 2606, in createExpression
return XPathExpression(expr,resolver)
File "/home/hlcc/public_html/handl-scrape/BSXPath.py", line 2537, in __init__
self.expr=BinaryExpr.parse(lexer)
File "/home/hlcc/public_html/handl-scrape/BSXPath.py", line 1030, in parse
expr=UnaryExpr.parse(lexer)
File "/home/hlcc/public_html/handl-scrape/BSXPath.py", line 1087, in parse
return UnionExpr.parse(lexer)
File "/home/hlcc/public_html/handl-scrape/BSXPath.py", line 1132, in parse
expr=PathExpr.parse(lexer)
File "/home/hlcc/public_html/handl-scrape/BSXPath.py", line 1246, in parse
path=PathExpr(FilterExpr.root()) # RootExpr
File "/home/hlcc/public_html/handl-scrape/BSXPath.py", line 1158, in __init__
self.needContextPosition=filter.needContextPosition
AttributeError: 'FunctionCall' object has no attribute 'needContextPosition'
So that makes me think that the restructuring of the code doesn't exactly work in the same way, or else I made a typo of some sort.
I also found this:
http://www.guyrutenberg.com/2007/10/12/conditional-expressions-in-python-24/
Could this be the correct way to do it in 2.4, do you think?
Thanks again,
Steve