1
我想從li
類中獲得innertext或更好的innerhtml。通過編號獲取html內部文本
在正常的桌面版本,它的工作原理。
,但相同的代碼上WP8不會起作用,因爲WP8不必須全部features.i年齡段:所有在互聯網上,我只是FINDE桌面或代碼的代碼不洙工作。
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>
「不會工作」不是一個問題的非常明確的解釋。請將您鏈接的內容嵌入到問題中。 –