visual studio 2010 - Parse table without id in vb.net -
i need parse items of table , display in various textbox
controls in vb.net.
<table class="forumline" border="0" width="90%"> <th colspan="3">information ipaddress 173.194.40.144</th> <tr> <td width="15%" align="right" colspan="1" class="row3"valign="top"><p align="center"><b>provider info</b></td> <td width-"15%" align="center" colspan="1" class="row3">country info</td> <td width="15%" align="center" colspan="1" class="row3"><b>time info</b></td> </tr> <tr> <td align="center" class="row1" width="15%">ip address<br><input type="text" name="t1" size="20" value="173.194.40.144"> </td> <td align="center" class="row1" width="15%">country<br><input type="text" name="t2" size="20" value="united states"></td> <td align="center" class="row1" width="15%">continent<br><input type="text" name="t3" size="20" value="north america"></td> </tr> <tr> <td align="center" class="row2" width="15%">hostname<br><input type="text" name="t4" size="20" value="par10s10-in-f16.1e100.net"></td> <td align="center" class="row2" width="15%">region (code)<br><input type="text" name="t8" size="20" value="california (ca)"></td> <td align="center" class="row2" width="15%">latitude<br><input type="text" name="t12" size="20" value="37.4192"></td> </tr> <tr> <td align="center" class="row1" width="15%">organization<br><input type="text" name="t5" size="20" value="google"></td> <td align="center" class="row1" width="15%">city<br><input type="text" name="t9" size="20" value="mountain view"></td> <td align="center" class="row1" width="15%">longitude<br><input type="text" name="t13" size="20" value="-122.0574"></td> </tr> <tr> <td align="center" class="row2" width="15%">isp<br><input type="text" name="t7" size="20" value="google"></td> <td align="center" class="row2" width="15%">areacode<br><input type="text" name="t10" size="20" value="650"></td> <td align="center" class="row2" width="15%">time zone<br><input type="text" name="t14" size="20" value="america/los_angeles"></td> </tr> <tr> <td align="center" class="row1" width="15%">flag<br><img src="flags/us.gif"></td> <td align="center" class="row1" width="15%">postalcode<br><input type="text" name="t11" size="20" value="94043"></td> <td align="center" class="row1" width="15%">gmt offset<br><input type="text" name="t15" size="20" value="-7"></td> </tr>
i data (ip address, country, continent,...gmt offset) when user clicks on button.
i tried use htmlagilitypack, maybe xpath better. don't know how use when table not have id. think must use td
name (ex name="t1"
) how?
private sub nsbutton1_click(byval sender system.object, byval e system.eventargs) handles nsbutton1.click dim url string = ("http://www.iptrackeronline.com/index.php?ip_address=" & nstextbox1.text) dim doc new htmlagilitypack.htmldocument doc.loadhtml(url) dim node htmlagilitypack.htmlnode
Comments
Post a Comment