示例#1
0
        void DropdownCheck(string str, bool nopanduan = true)
        {
            //循环5次,每次加150
            int len = 150;

            for (int i = 0; i < 5; i++)
            {
                DropdownSetScroll(i * len);
                DropdownSetScroll_Sheng(i * len);
                wait();
                //获取li的数量
                int licount = chrome.JS_CEFBrowserToInt("document.getElementsByClassName('" + classname_dropdown + "')[0].getElementsByTagName('li').length");

                //循环li
                for (int j = 0; j < licount; j++)
                {
                    //判断每个li的文字中是否有制定文字
                    string temp = chrome.JS_CEFBrowser("document.getElementsByClassName('" + classname_dropdown + "')[0].getElementsByTagName('li')[" + j + "].innerText");
                    //如果有
                    if (temp.IndexOf(str) > -1)
                    {
                        if (nopanduan)
                        {
                            //则判断是否已经被选中
                            if (!chrome.JS_CEFBrowserToBool("document.getElementsByClassName('" + classname_dropdown + "')[0].getElementsByClassName('" + classname_check + "')[" + j + "].checked==true"))
                            {
                                //如果没有选中则选中
                                ClickDropdown(j);
                            }
                        }
                        else
                        {
                            ClickDropdown(j);
                        }
                    }
                }
            }

            chrome.MouseLeftByHtmlElement("document.getElementsByClassName('Grid_row_4-62-1')[0].getElementsByTagName('label')[0]", true);
        }
示例#2
0
 void ClickOther()
 {
     chrome.MouseLeftByHtmlElement("getElementsByClassName_Vague('Grid_row_')[0].getElementsByTagName('label')[0]", true);
 }