日期:2014-05-18  浏览次数:20931 次

XML文件解析,求解
API:
http://open.client.lashou.com/api/detail/city/西安/p/1/r/10
得到:
C# code
<urlset count="286"><url id="1"><loc>http://xian.lashou.com/deal/864007.html</loc><wap_url>http://m.lashou.com/detail.php?id=864007</wap_url><data><display><website>拉手网</website><cate>休闲</cate><siteurl>http://xian.lashou.com/</siteurl><city>西安</city><gid>864007</gid><title>仅售198元!市场价1080元的唯卡视觉个性写真套系1份:4套服装+4组造型+拍摄不少于60张+精修23张+街景1组+内景3组+成品10件+底片全送(需自带U盘拷取)!每周周四商家休假不能接待,请见谅!</title><image>http://s1.lashouimg.com/zt/201206/04/133880430157690400.jpg</image><small_image>http://s2.lashouimg.com/zt_220/201206/04/133880430157690400.jpg</small_image><startTime>1338825600</startTime><endTime>1343664000</endTime><value>1080.00</value><price>198.00</price><rebate>1.8</rebate><bought>116</bought><detail>独家特色,打造独特唯美的自我,留住最完美的瞬间!</detail><shops><shop><name>唯卡视觉原创摄影</name><tel>029-87383808</tel><addr>西安市解放路77号裕朗国际530室(民乐园步行街南口)</addr><longitude>108.96389</longitude><latitude>34.26562</latitude></shop></shops></display></data></url><url id="2"><loc>http://xian.lashou.com/deal/867538.html</loc><wap_url>http://m.lashou.com/detail.php?id=867538</wap_url><data><display><website>拉手网</website><cate>美食</cate><siteurl>http://xian.lashou.com/</siteurl><city>西安</city><gid>867538</gid><title>仅售68元!市场价208元的老库酒吧四人套餐1份:七彩三明治+日本什锦寿司+红酒水果沙拉+印尼珍珠炒饭+烤鸡翅+法式烤面包+香蕉船圣代+西瓜汁/哈密瓜汁/芒果汁(3选1)!</title><image>http://s1.lashouimg.com/zt/201206/07/133903931967168600.jpg</image><small_image>http://s2.lashouimg.com/zt_220/201206/07/133903931967168600.jpg</small_image><startTime>1339344000</startTime><endTime>1343664000</endTime><value>208.00</value><price>68.00</price><rebate>3.3</rebate><bought>9</bought><detail>有些烦恼,丢掉了,才有云淡风轻的机会。</detail><shops><shop><name>老库酒吧</name><tel>029-68732312</tel><addr>西安市丈八东路与明德路十字交汇处</addr><longitude>108.93546</longitude><latitude>34.19848</latitude></shop></shops></display></data></url><url id="3"><loc>http://xian.lashou.com/deal/867923.html</loc><wap_url>http://m.lashou.com/detail.php?id=867923</wap_url><data><display><website>拉手网</website><cate>休闲</cate><siteurl>http://xian.lashou.com/</siteurl><city>西安</city><gid>867923</gid><title>仅售24元!市场价60元的圆缘源茶苑相声门票1张!需兑票!端午节期间(2012年6月22日-24日)拉手券不能使用!</title><image>http://s1.lashouimg.com/zt/201206/08/133914313460190100.jpg</image><small_image>http://s2.lashouimg.com/zt_220/201206/08/133914313460190100.jpg</small_image><startTime>1339344000</startTime><endTime>1343664000</endTime><value>60.00</value><price>24.00</price><rebate>4</rebate><bought>57</bought><detail>看一看、听一听,生活更加乐逍遥!</detail><shops><shop><name>圆缘源茶苑</name><tel>82068088</tel><addr>西安市雁塔区雁塔北路59号建东街西口秋林公司斜对面</addr><longitude>108.94866</longitude><latitude>34.22247</latitude></shop></shops></display></data></url></urlset>


因为需要做一个和百度团购差不多的,所以我只需要解析出部分数据就好了。

目前写法: