'Children HtmlElement
'Html 的子選項 Children
'使用方式如下


Dim ElemColl As HtmlElementCollection

web.WebBrowser1.Navigate("http://anywhere")
Loading()


For Each myweb3 As HtmlElement In web.WebBrowser1.Document.GetElementsByTagName("select")

'把所有的 子選項列入進去
ElemColl = myweb3.Children

If myweb3.Id = "user_height1" Then


'myweb3 .Children

'在這邊 為了挑選出子選項
For Each MyWeb1 As HtmlElement In ElemColl

   If MyWeb1.GetAttribute("value") <> Nothing Then

     If MyWeb1.GetAttribute("value") = C_box身高.SelectedItem Then

         MyWeb1.SetAttribute("Selected", "Ture")

         MyWeb1.InvokeMember("click")

     End If
End If

Next
End If
Next

arrow
arrow

    dark99 發表在 痞客邦 留言(0) 人氣()