我确实有一个 HTML 代码,我想从中获取文本,但几乎文本不在任何 HTML 标签内。
html
<div class="div-estro">
<b class="">Your</b>
<b class="">ID:</b> 3915
<b class="">Time Limit:</b> 00:19:56
<b class="">IP:</b> 123.101.59.87
<b class="">Membership Period:</b> 8 year <br>
<b class="">CountryID:</b> 78
<b class="">Country:</b> US
<b class="">State:</b> OH
<b class="">City:</b> Akron
<b class="">Status:</b> Available
<b class="">Maximum Queue:</b> 4
<b class=""><br>CountryProxy:</b> 201.250.101.84:3372
<b class="">CountryIP:</b> 59.243.44.192
</div>
我想从 CountryIP 和 CountryProxy 获取文本。
期待 gettext 字符串:201.250.101.84 : 3372
期待 gettext 字符串:59.243.44.192
我试过 xpaths :
//div[@class='div-estro']//text()[12]
//div[@class='div-estro']//text()[13]
当我使用 firebug 进行评估时,上面的 xpath 看起来不错。但是当尝试使用 selenium 获取文本时,我遇到了异常。
慕斯王
慕森王
相关分类