Lxml html xpath context

后端 未结 1 1598
一向
一向 2021-02-15 16:11

I\'m using lxml to parse a HTML file and I\'d like to know how can I set the context of xpath search. What I mean I that I have a node element and want to make xpat

1条回答
  •  北恋
    北恋 (楼主)
    2021-02-15 16:49

    XPath expression //input will match all input elements, anywhere in your document, while .//input will match all inside current context.

    Maybe if you improve your scenario description we can help you further.

    0 讨论(0)
提交回复
热议问题