Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 通过Awesomium锚环&;点击它们_C#_.net_Visual Studio 2013_Webbrowser Control_Awesomium - Fatal编程技术网

C# 通过Awesomium锚环&;点击它们

C# 通过Awesomium锚环&;点击它们,c#,.net,visual-studio-2013,webbrowser-control,awesomium,C#,.net,Visual Studio 2013,Webbrowser Control,Awesomium,请看一下这些线程: 现在,对于web浏览器控件上的所有锚点上的循环,我编写了以下代码: string js = @"(function() { if(window.jQuery) { alert('Yeah!'); }

请看一下这些线程:


现在,对于web浏览器控件上的所有锚点上的循环,我编写了以下代码:

   string js = @"(function() {
                                if(window.jQuery)
                                {
                                    alert('Yeah!');
                                }
                                else
                                {
                                    alert('nope');
                                }
                                var elements = [];
                                $('a').each(function(){
                                    //alert($(this).attr('href'));
                                      elements.push($(this));
                                });
                                alert(elements);
                                return elements;
                               })();";
    JSValue result = webBrowser_extra.ExecuteJavascriptWithResult(js);
    JSValue[] elements;

    if (result.IsNull)
    {
        MessageBox.Show(result + " : IsNull");
    }
    if (!result.IsArray)
    {
        MessageBox.Show(result + " : ! IsArray");
    }

    elements = (JSValue[])result;
    foreach (JSValue item in elements)
    {
        if (item != null)
        {
           //Here i want to access href value of element and click on it, but how??????????
        }
    }
我想在我的页面中循环所有锚,获取所有href值并将它们收集到一个列表中,然后单击每个元素,而不使用它的href。
为此,我如何编辑代码