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
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(
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 of nodes
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
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
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
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 the number
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
Hi.
Got a test web page, that basically has two html tags in it. Examining
the page via Firefox/Dom Inspector, I can create a test xpath query
/html/body/form which gets the target form for the test.
The issue comes when I examine the page's source html. It looks like:
html
body
/body
/html
bruce schrieb:
Hi.
Got a test web page, that basically has two html tags in it. Examining
the page via Firefox/Dom Inspector, I can create a test xpath query
/html/body/form which gets the target form for the test.
The issue comes when I examine the page's source html. It looks like:
html
body
(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
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?
nit
There's no sibling axis in XPath. I'm sure you meant
following-sibling and/or
bruce [EMAIL PROTECTED] writes:
i have the following section of test code where i'm trying to get the
attribute of a frame
frame src=
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
hi...
i have the following section of test code where i'm trying to get the
attribute of a frame
frame src=
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
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
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 want to
[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 situation where
[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 situation
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:
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 something
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, but i'm not sure how
to do it...
i have a situation
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 like [EMAIL
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:
23 matches
Mail list logo