Maybe even easier: string() in the XPATH:

===
description = tree.xpath('string(//meta[@name="description"]/@content)')
print(description)
===

best, /PA

On Fri, 27 May 2022 at 19:03, <[email protected]> wrote:

> For others' benefit:
>
> =======
> description = tree.xpath("//meta[@name='description']/@content")
> print(description[0])
> =======
> _______________________________________________
> lxml - The Python XML Toolkit mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/lxml.python.org/
> Member address: [email protected]
>


-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet
_______________________________________________
lxml - The Python XML Toolkit mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/lxml.python.org/
Member address: [email protected]

Reply via email to