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
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
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
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
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
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
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
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
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
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("
"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
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-
(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
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
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
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
[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
[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
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
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
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
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
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//
23 matches
Mail list logo