1
ctl00_Content_ctl00_chkProduct_0
ctl00_Content_ctl00_chkProduct_1
ctl00_Content_ctl00_chkProduct_2
...
ctl00_Content_ctl00_chkProduct_19
ctl00_Content_ctl00_chkProduct_20

21 個の要素すべてを数えるには、どの式を使用すればよいですか?

私は使用しました

decimal count = selenium.GetXpathCount("//*[@id='ctl00_Content_ctl00_chkProduct_.*']");
decimal count = selenium.GetXpathCount("//*[@id='ctl00_Content_ctl00_chkProduct_[.*]']");
decimal count = selenium.GetXpathCount("//*[@id='ctl00_Content_ctl00_chkProduct_.']");

しかし、どれも機能しませんでした...助けてください。

4

1 に答える 1

2

使用する:

//*[starts-with(@id,'ctl00_Content_ctl00_chkProduct_')]
于 2010-11-30T22:16:00.527 に答える