-1
我使用Xamarin.Forms和HTML Agility Pack來解析我的HTML。在Windows UWP它工作,我得到一個'a'的節點,與Android目標我得到空結果。Xamarin.Forms:DocumentNode.Descendants在Android設備上返回null
我的目標是獲取視頻文件的名稱。
var nodes = doc.DocumentNode.Descendants("a").FirstOrDefault(x => x.Attributes.Contains("class") && x.Attributes["class"].Value == "mediafallbacklink");
doc.DocumentNode.Descendants()。首先()爲空過。
與Android設備的HTML是否存在問題?如果是這樣,爲什麼?
<div class="no-overflow"><p><p>This is a test.</p><p><span class="mediaplugin mediaplugin_qt">
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="400" height="315">
<param name="pluginspage" value="http://www.apple.com/quicktime/download/">
<param name="src" value="video_2016-06-24_19-12-25.mov">
<param name="controller" value="true">
<param name="loop" value="false">
<param name="autoplay" value="false">
<param name="autostart" value="false">
<param name="scale" value="aspect">
<!--[if !IE]><!-->
<object data="video_2016-06-24_19-12-25.mov" type="video/quicktime" width="400" height="315">
<param name="src" value="video_2016-06-24_19-12-25.mov">
<param name="pluginurl" value="http://www.apple.com/quicktime/download/">
<param name="controller" value="true">
<param name="loop" value="false">
<param name="autoplay" value="false">
<param name="autostart" value="false">
<param name="scale" value="aspect">
<!--<![endif]-->
<a class="mediafallbacklink" href="video_2016-06-24_19-12-25.mov">video_2016-06-24_19-12-25.mov</a>
<!--[if !IE]><!-->
</object>
<!--<![endif]-->
</object>
</span><br></p><br><p></div>