2016-08-31 93 views
0

我想從HTML頁面中的腳本獲取變量(對象)。 但在C#代碼上它返回System._comobject。我如何閱讀這個對象?Invokescript()返回System._Comobject

JS代碼:

var videoUrls ={}; 
function test(){ 


var typea= ytplayer.config.args.url_encoded_fmt_stream_map.split(','); 
for (var item=0; item<typea.length; item++){ 
    var obj= {}; 
    var typeb= typea[item].split('&'); 
    for (var param=0; param<typeb.length; param++){ 

    typeb[param]= typeb[param].split('='); 
    obj[typeb[param][0]] = decodeURIComponent(typeb[param][1]); 

    } 

videoUrls[obj.quality]= obj; 
} 
} 

C#:

browseme.Document.InvokeScript("test"); 
var result = browseme.Document.InvokeScript("eval", new object[] { "videoUrls" }); 

總之,我試圖做到這一點,運行 「測試」 功能則得到 「videoUrls」。並閱讀其內容。

變量輸出在瀏覽器控制檯中的顯示效果如何。

Image

在此先感謝。

回答

相關問題