我正在使用Watin,我想在页面源(HTML)中搜索,比如ctrl + F搜索,最好的方法是什么?
thanx任何帮助, 什兰
答案 0 :(得分:1)
这应该对你有所帮助,这是一个如何实现它的例子
// Find text like ctr+F (NOT IN SOURCE BUT IN "WHAT YOU SEE"
if (ie.Text.Contains("SOME TEXT TO FIND").Equals(true))
{
//Do stuff you would like when found here
MessageBox.Show("Text Found! ");
}
else
{
// cant find
}
//OR
// Find text in SOURCE
if (ie.Html.Contains("SOME TEXT TO FIND").Equals(true))
{
//Do stuff you would like when found here
MessageBox.Show("Text Found! ");
}
else
{
// cant find
}
答案 1 :(得分:0)