c# webbrowser控件中,选定radio项的问题

c# webbrowser控件中,选定radio项的问题,
做一个自动答卷的小工具,分析网页代码发现选项的文字没有写在input中,而是放在了input后面的label中,这下我怎么才能确定正确答案究竟是ABCD哪个选项呢?

 A:<input id="GridView1_ctl17_RadioButton1" type="radio" name="GridView1$ctl17$Sl" value="RadioButton1" /><label for="GridView1_ctl17_RadioButton1">A. which  </label>

B:<input id="GridView1_ctl17_RadioButton2" type="radio" name="GridView1$ctl17$Sl" value="RadioButton2" /><label for="GridView1_ctl17_RadioButton2">B. with whom  </label>

C:<input id="GridView1_ctl17_RadioButton3" type="radio" name="GridView1$ctl17$Sl" value="RadioButton3" /><label for="GridView1_ctl17_RadioButton3">C. whom  </label>

D:<input id="GridView1_ctl17_RadioButton4" type="radio" name="GridView1$ctl17$Sl" value="RadioButton4" /><label for="GridView1_ctl17_RadioButton4">D. with which</label>

1个回答

你先获取每个选项,然后得到后面label对应的字符串,然后你答题程序比较选择对应的

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问