Html Agility Pack - Problem selecting subnode

前端 未结 2 1696
灰色年华
灰色年华 2020-12-08 00:55

I want to export my Asics running plan to iCal and since Asics do not offer this service, I decided to build a little scraper for my own personal use. What I want to do is t

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-08 01:37

    In XPATH, // means all children and grand children below the current node. So you need to come up with a more restrictive XPATH expression. If you provide the real HTML, and what you're looking for exactly, we can help you dig further.

    About the error you have:

    .div[@class='date'] is invalid because . is sticked to div. You could use div[@class='date'], or ./div[@class='date'] which I believe are equivalent. This is because . is an XPATH axe, which is an alias for self and means "the current node".

提交回复
热议问题