我想从下班获得内部文本甚至更好的内部HTML li
。
在普通桌面版本中它可以工作。
但是相同的代码在 WP8 上不起作用,因为 wp8 没有所有功能。我在整个互联网上搜索,我发现只是桌面代码或不起作用的代码。
HtmlElement e1 = webBrowser1.Document.GetElementById(textBox2.Text);
string content = e1.InnerText;
textBox1.Text = content;
有一个 HTML 表单,我想得到相同的结果,就像我用 c# 的“桌面”版本得到的一样
<li id="ContentHolderMain_ContentHolderMainContent_ContentHolderMainContent_lstvAlphabet_listRestaurants_0_lstvRestaurant_0_liItem_0" class="restaurantItem" sssp:rs="2;7;8;10;" sssp:rl="Ljubljana" sssp:rn=""Celica hostel"">
<div class="name">
<h1>
<h2>(Metelkova 8, Ljubljana)</h2>
<span class="blocked"></span>
<span class="blocked"> </span>
</div>
<div class="breaker"></div>
<div class="prices">
<p>
<span>Vrednost doplacila:</span>
<strong>3,15 EUR</strong>
</p>
<p>
<span>Vrednost obroka:</span>
<strong>5,78 EUR</strong>
</p>
</div>
<div class="features">
<img id="ContentHolderMain_ContentHolderMainContent_ContentHolderMainContent_lstvAlphabet_listRestaurants_0_lstvRestaurant_0_lstvFeatures_0_imgFeature_0" title="Celiakiji prijazni obroki" alt="Celiakiji prijazni obroki" src="/App_Themes/SOS/images/icncoeliac.png">
<img id="ContentHolderMain_ContentHolderMainContent_ContentHolderMainContent_lstvAlphabet_listRestaurants_0_lstvRestaurant_0_lstvFeatures_0_imgFeature_1" title="Solatni bar" alt="Solatni bar" src="/App_Themes/SOS/images/icnsaladbar.png">
<img id="ContentHolderMain_ContentHolderMainContent_ContentHolderMainContent_lstvAlphabet_listRestaurants_0_lstvRestaurant_0_lstvFeatures_0_imgFeature_2" title="Stalen arhitektonsko prilagojen dostop za invalide in dostop do mize v notranjosti lokala ter do toalete prilagojene za invalide" alt="Stalen arhitektonsko prilagojen dostop za invalide in dostop do mize v notranjosti lokala ter do toalete prilagojene za invalide" src="/App_Themes/SOS/images/icnwheelchairwc.png">
<img id="ContentHolderMain_ContentHolderMainContent_ContentHolderMainContent_lstvAlphabet_listRestaurants_0_lstvRestaurant_0_lstvFeatures_0_imgFeature_3" title="Kosila" alt="Kosila" src="/App_Themes/SOS/images/icnlunch.png">
</div>
<div class="breaker"></div>
</li>