如何在sql这个例子中获取节点href? 这是我的代码:
<h2 style="font-size: 2.3em; text-align:center;margin-bottom:10px;">SELECT YOUR ACER SERIES</h2>
<div class="models_selector_block" >
<div class="ls_black_series_selector " style="min-width:500px;"><b>LAPTOPS</b>
<DIV class="msb_item">
<a class="ser_selector" href="javascript:if(confirm(%27http://www.laptopscreen.com/English/series/Acer/ASPIRE/ \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?%27))window.location=%27http://www.laptopscreen.com/English/series/Acer/ASPIRE/%27" tppabs="http://www.laptopscreen.com/English/series/Acer/ASPIRE/">ASPIRE</a>
<br/>
<a style="color:#000; font-size:10px;padding-left: 15px;" href="javascript:if(confirm(%27http://www.laptopscreen.com/English/series/Acer/ASPIRE/ \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?%27))window.location=%27http://www.laptopscreen.com/English/series/Acer/ASPIRE/%27" tppabs="http://www.laptopscreen.com/English/series/Acer/ASPIRE/">ASPIRE LCD Screen</a>
</DIV>
<DIV class="msb_item">
<a class="ser_selector" href="javascript:if(confirm(%27http://www.laptopscreen.com/English/series/Acer/EXTENSA/ \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?%27))window.location=%27http://www.laptopscreen.com/English/series/Acer/EXTENSA/%27" tppabs="http://www.laptopscreen.com/English/series/Acer/EXTENSA/">EXTENSA</a>
<br/>
<a style="color:#000; font-size:10px;padding-left: 15px;" href="javascript:if(confirm(%27http://www.laptopscreen.com/English/series/Acer/EXTENSA/ \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?%27))window.location=%27http://www.laptopscreen.com/English/series/Acer/EXTENSA/%27" tppabs="http://www.laptopscreen.com/English/series/Acer/EXTENSA/">EXTENSA LCD Screen</a>
</DIV>
<DIV class="msb_item">
<a class="ser_selector" href="javascript:if(confirm(%27http://www.laptopscreen.com/English/series/Acer/FERRARI/ \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?%27))window.location=%27http://www.laptopscreen.com/English/series/Acer/FERRARI/%27" tppabs="http://www.laptopscreen.com/English/series/Acer/FERRARI/">FERRARI</a>
<br/>
<a style="color:#000; font-size:10px;padding-left: 15px;" href="javascript:if(confirm(%27http://www.laptopscreen.com/English/series/Acer/FERRARI/ \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?%27))window.location=%27http://www.laptopscreen.com/English/series/Acer/FERRARI/%27" tppabs="http://www.laptopscreen.com/English/series/Acer/FERRARI/">FERRARI LCD Screen</a>
</DIV>
<DIV class="msb_item">
<a class="ser_selector" href="javascript:if(confirm(%27http://www.laptopscreen.com/English/series/Acer/ICONIA/ \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?%27))window.location=%27http://www.laptopscreen.com/English/series/Acer/ICONIA/%27" tppabs="http://www.laptopscreen.com/English/series/Acer/ICONIA/">ICONIA</a>
<br/>
<a style="color:#000; font-size:10px;padding-left: 15px;" href="javascript:if(confirm(%27http://www.laptopscreen.com/English/series/Acer/ICONIA/ \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?%27))window.location=%27http://www.laptopscreen.com/English/series/Acer/ICONIA/%27" tppabs="http://www.laptopscreen.com/English/series/Acer/ICONIA/">ICONIA LCD Screen</a>
</DIV>
<DIV class="msb_item">
<a class="ser_selector" href="javascript:if(confirm(%27http://www.laptopscreen.com/English/series/Acer/TRAVELMATE/ \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?%27))window.location=%27http://www.laptopscreen.com/English/series/Acer/TRAVELMATE/%27" tppabs="http://www.laptopscreen.com/English/series/Acer/TRAVELMATE/">TRAVELMATE</a>
<br/>
<a style="color:#000; font-size:10px;padding-left: 15px;" href="javascript:if(confirm(%27http://www.laptopscreen.com/English/series/Acer/TRAVELMATE/ \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?%27))window.location=%27http://www.laptopscreen.com/English/series/Acer/TRAVELMATE/%27" tppabs="http://www.laptopscreen.com/English/series/Acer/TRAVELMATE/">TRAVELMATE LCD Screen</a>
</DIV>
<DIV class="msb_item">
<a class="ser_selector" href="javascript:if(confirm(%27http://www.laptopscreen.com/English/series/Acer/Other Acer Models/ \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?%27))window.location=%27http://www.laptopscreen.com/English/series/Acer/Other Acer Models/%27" tppabs="http://www.laptopscreen.com/English/series/Acer/Other Acer Models/">Other Acer Models</a>
<br/>
<a style="color:#000; font-size:10px;padding-left: 15px;" href="javascript:if(confirm(%27http://www.laptopscreen.com/English/series/Acer/Other Acer Models/ \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?%27))window.location=%27http://www.laptopscreen.com/English/series/Acer/Other Acer Models/%27" tppabs="http://www.laptopscreen.com/English/series/Acer/Other Acer Models/">Other Acer Models LCD Screen</a>
</DIV>
</div>
<div class="ls_black_series_selector phone_tablet_block" >
<b>TABLETS</b>
<DIV class="msb_item">
<a class="ser_selector" href="javascript:if(confirm(%27http://www.laptopscreen.com/English/series/Acer/ASPIRE/ \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?%27))window.location=%27http://www.laptopscreen.com/English/series/Acer/ASPIRE/%27" tppabs="http://www.laptopscreen.com/English/series/Acer/ASPIRE/">ASPIRE</a>
<br/>
<a style="color:#000; font-size:10px;padding-left: 15px;" href="javascript:if(confirm(%27http://www.laptopscreen.com/English/series/Acer/ASPIRE/ \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?%27))window.location=%27http://www.laptopscreen.com/English/series/Acer/ASPIRE/%27" tppabs="http://www.laptopscreen.com/English/series/Acer/ASPIRE/">ASPIRE LCD Screen</a>
</DIV>
<DIV class="msb_item">
<a class="ser_selector" href="javascript:if(confirm(%27http://www.laptopscreen.com/English/series/Acer/ICONIA/ \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?%27))window.location=%27http://www.laptopscreen.com/English/series/Acer/ICONIA/%27" tppabs="http://www.laptopscreen.com/English/series/Acer/ICONIA/">ICONIA</a>
<br/>
<a style="color:#000; font-size:10px;padding-left: 15px;" href="javascript:if(confirm(%27http://www.laptopscreen.com/English/series/Acer/ICONIA/ \n\nThis file was not retrieved by Teleport Pro, because it was unavailable, or its retrieval was aborted, or the project was stopped too soon. \n\nDo you want to open it from the server?%27))window.location=%27http://www.laptopscreen.com/English/series/Acer/ICONIA/%27" tppabs="http://www.laptopscreen.com/English/series/Acer/ICONIA/">ICONIA LCD Screen</a>
</DIV>
</div><br clear="both"/>
</div>
'
SELECT t.v.value('.','nvarchar(max)') as [Name Of Brand],
t.v.value('@href','nvarchar(max)') as [URL Local]
FROM @htmlXML.nodes('div/a') as t(v)
or
SELECT t.v.value('.','nvarchar(max)') as [Name Of Brand],
t.v.value('@title','nvarchar(max)') as [Title Of Brand],
t.v.value('@href','nvarchar(max)') as [URL Local],
t.v.value('@tppabs','nvarchar(max)') as [URL Site]
FROM @htmlXML.nodes('div/div[1]/DIV/a[1]') as t(v)
我想要动态节点 DIV / DIV [I] / DIV / A [1] 我尝试使用代码,但我不能解决我的问题。 对我来说非常重要。 谢谢,谢谢
感谢您的提示........................................... .................................................. ...........................................