Re: pythojn/xpath question...

2009-02-16 Thread Diez B. Roggisch
bruce schrieb: hi... using libxml2dom as the xpath lib i've got a situation where i can have: foo=a.xpath( /html/body/table[2]/tr[45]/td) and i can get 11 as the number of returned td elements for the 45th row... this is as it should be. however, if i do: foo=a.xpath( /html/body/table[2]/t

pythojn/xpath question...

2009-02-16 Thread bruce
hi... using libxml2dom as the xpath lib i've got a situation where i can have: foo=a.xpath( /html/body/table[2]/tr[45]/td) and i can get 11 as the number of returned td elements for the 45th row... this is as it should be. however, if i do: foo=a.xpath( /html/body/table[2]/tr) and then try

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/te

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 s

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 - firefox dom/xpath question/issue

2008-08-25 Thread Diez B. Roggisch
bruce schrieb: Hi. Got a test web page, that basically has two " . . . I've simplified things a bit... but basically, the 1st "html/body" is empty, with the 2nd containing the data/nodes I need. If that's your document, it is invalid XML - XML only allows *one* root. Thus the parsers

python - firefox dom/xpath question/issue

2008-08-25 Thread bruce
Hi. Got a test web page, that basically has two " . . . I've simplified things a bit... but basically, the 1st "html/body" is empty, with the 2nd containing the data/nodes I need. In using xpath("/html/body/form"), the app returns nothing/crashes.. I've tried to do something like xpath("

Re: xpath question...

2006-07-09 Thread John J. Lee
"bruce" <[EMAIL PROTECTED]> writes: > i have the following section of test code where i'm trying to get the > attribute of a frame > > > i'm trying to print/get the src value. the xpath query that i have displays > the "src" attribute in the Xpather/Firefox plugin. however, i can't quite > fi

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

xpath question...

2006-07-08 Thread bruce
hi... i have the following section of test code where i'm trying to get the attribute of a frame i'm trying to print/get the src value. the xpath query that i have displays the "src" attribute in the Xpather/Firefox plugin. however, i can't quite figure out how to get the underlying value in

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

Re: xpath question

2006-07-04 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > bruce wrote: >> is there anyone with XPath expertise here? i'm trying to figure out if >> there's a way to use regex expressions with an xpath query? i've seen >> references to the ability to use regex and xpath/xml, but i'm not sure how >> to do it... >> >> i have a situ

Re: xpath question

2006-07-03 Thread Simon Forman
[EMAIL PROTECTED] wrote: > bruce wrote: > > is there anyone with XPath expertise here? i'm trying to figure out if > > there's a way to use regex expressions with an xpath query? i've seen > > references to the ability to use regex and xpath/xml, but i'm not sure how > > to do it... > > > > i have

Re: xpath question

2006-07-02 Thread uche . ogbuji
bruce wrote: > is there anyone with XPath expertise here? i'm trying to figure out if > there's a way to use regex expressions with an xpath query? i've seen > references to the ability to use regex and xpath/xml, but i'm not sure how > to do it... > > i have a situation where i have something like

Re: xpath question

2006-07-02 Thread Simon Forman
bruce wrote: > simon.. > > you may not.. but lot's of people use python and xpath for html/xml > functionality.. check google "python xpath"... > > later.. > ... > > i have a situation where i have something like: > > /html/table//[EMAIL PROTECTED]'foo'] > > > > is it possible to do soomething

RE: xpath question

2006-07-02 Thread bruce
list@python.org Subject: Re: xpath question bruce wrote: > hi > > is there anyone with XPath expertise here? i'm trying to figure out if > there's a way to use regex expressions with an xpath query? i've seen > references to the ability to use regex and xpath/xml, bu

Re: xpath question

2006-07-02 Thread Simon Forman
bruce wrote: > hi > > is there anyone with XPath expertise here? i'm trying to figure out if > there's a way to use regex expressions with an xpath query? i've seen > references to the ability to use regex and xpath/xml, but i'm not sure how > to do it... > > i have a situation where i have somethi

RE: xpath question

2006-07-02 Thread bruce
hi is there anyone with XPath expertise here? i'm trying to figure out if there's a way to use regex expressions with an xpath query? i've seen references to the ability to use regex and xpath/xml, but i'm not sure how to do it... i have a situation where i have something like: /html/table//