Re: python/xpath question..

2008-09-04 Thread Stefan Behnel
Stefan Behnel wrote: > Yes, learn to use XPath, e.g. > > //tr/td[not string()] Oh, well... //tr/td[not(string())] as I said, wrong news group. ;-) Try something like "gmane.text.xml.xpath.general", for example. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: python/xpath question..

2008-09-04 Thread Stefan Behnel
Hi, you should really read about XPath. There are also newsgroups specifically for this topic, please use them. bruce wrote: > in my python, i'm using the xpath function to iterate/parse some html. i can > do something like > > s=d.xpath("//tr/td/text()") > count=len(s) > > and get the number

Re: python/xpath question..

2008-09-03 Thread John Krukoff
On Wed, 2008-09-03 at 13:36 -0700, bruce wrote: > morning > > i apologize up front as this is really more of an xpath question.. > > in my python, i'm using the xpath function to iterate/parse some html. i can > do something like > > s=d.xpath("//tr/td/text()") > count=len(s) > > and get th

Re: [wwwsearch-general] python/xpath question..

2008-09-03 Thread John J Lee
On Wed, 3 Sep 2008, bruce wrote: [...] and get the number of total nodes... by subtracting, i can get the number of nodes, without text.. is there an easier way??!! [...] Yes -- don't use XPath :-) John -- http://mail.python.org/mailman/listinfo/python-list

python/xpath question..

2008-09-03 Thread bruce
morning i apologize up front as this is really more of an xpath question.. in my python, i'm using the xpath function to iterate/parse some html. i can do something like s=d.xpath("//tr/td/text()") count=len(s) and get the number of nodes that have text i can then do something like s=d.xpa

python XPATH question - mechanize/libxml2dom

2008-09-01 Thread bruce
hi... i can use an xpath query to create a node from an html/dom representation. however, if i have a node, is there a way to generate an xpath query from the node. in testing with firefox/dom inspector, i can use "ancestor::*", but i can't determine where/how to implement this using mechanize/li

Re: python/xpath question...

2006-07-09 Thread John J. Lee
Stefan Behnel <[EMAIL PROTECTED]> writes: [...] > I'm not quite sure how this is supposed to be related to Python, but if you're > trying to find a sibling, what about using the "sibling" axis in XPath? There's no "sibling" axis in XPath. I'm sure you meant "following-sibling" and/or "preceding-

Re: python/xpath question...

2006-07-09 Thread John J. Lee
(Damn gmane's authorizor, I think I lost four postings because the auth messages went to my work email address (and I thought the authorization was supposed to be one-time only per group anyway??). I deleted them as spam since I hadn't posted from there for days :-( Grrr. At least I could reconst

Re: python/xpath question...

2006-07-06 Thread Stefan Behnel
bruce wrote: > for guys with python/xpath expertise.. > > i'm playing with xpath.. and i'm trying to solve an issue... > > i have the following kind of situation where i'm trying to get certain data. > > i have a bunch of tr/td... > > i can create an xpath, that gets me all of the tr.. i only w

python/xpath question...

2006-07-06 Thread bruce
for guys with python/xpath expertise.. i'm playing with xpath.. and i'm trying to solve an issue... i have the following kind of situation where i'm trying to get certain data. i have a bunch of tr/td... i can create an xpath, that gets me all of the tr.. i only want to get the sibling tr up un