0
<TABLE cellSpacing=0 cellPadding=4 width="100%" border=0>
<TBODY><TR><TD><TABLE cellSpacing=0 cellPadding=0 width=515 bgColor=#ffffff border=0>
<TBODY><TR><TD>
<h4 class="style1"> RESULTS (PROVISIONAL)</h4>
<h4><br>

<br></b>
<br>

&nbsp;</h4>

<TR>
     <TD width="513">

<B>THONGAM DEEPAK SINGH (1kn06cs054) </B><br><br><br><br><hr>
<table><tr><td><b>Semester:</b></td><td><b>8</b></td><td></td>
<td> &nbsp;&nbsp;&nbsp;&nbsp;<b> Result:&nbsp;&nbsp;FAIL </b></td></tr></table> 
<hr> <table><tr><td width=250>Subject</td><td width=60 align=center>External </td>
<td width=60 align=center>Internal</td><td align=center width=60>Total</td><td    align=center width=60>Result</td></tr><br><tr>
<td width=250><i>Programming Languages (06CS846)</i></td><td width=60  align=center>11</td><td width=60 align=center>18</td><td width=60 align=center>29</td><td  width=60 align=center><b>F</b></td></tr></table><br><br><table><tr><td></td><td></td><td>Total Marks:</td><td> 29 &nbsp;&nbsp;&nbsp; </td></tr></table>

This is the part of html result i am getting upon querying http://results.vtu.ac.in/ with usn=1kn06cs054.
I need to query the result table and store it in local database how can i query it using xpath. i need to store and display oputput as

Name=THONGAM DEEPAK SINGH  
Usn=1kn06cs054  
Semester=8  
Subject=Programming language  
Subject code=06cs846  
external-11  
internal-18  
total=29  
result = Fail  

I am new to parsing so not much idea about doing . solutions with code will be highly appreciated Thanks

lonesomeday
  • 233,373
  • 50
  • 316
  • 318
  • 1
    *(related)* [Best Methods to parse HTML](http://stackoverflow.com/questions/3577641/best-methods-to-parse-html/3577662#3577662) – Gordon Jan 31 '11 at 18:58
  • 1
    @Gordon: I think this is so open question that it could be considered as duplicate of that you have posted. –  Jan 31 '11 at 19:11
  • @Alejandro wasn't sure of that, but agreed :) – Gordon Jan 31 '11 at 19:14

1 Answers1

0

What you get there can never be queried using XPATH, it's not valid XML.

Dr.Molle
  • 116,463
  • 16
  • 195
  • 201
  • Not an issue when using PHP's DOM extension. – Gordon Jan 31 '11 at 18:54
  • So show me how to create with PHP-DOM a XML-document of that c***(that's what you need when using XPATH). I'm willing to learn. – Dr.Molle Jan 31 '11 at 18:57
  • 1
    All you have to do is use `loadHTML` or `loadHTMLFile`. That will make DOM use libxml's HTML Parser Module instead of the XML parser module. And that can be used with XPath. – Gordon Jan 31 '11 at 19:00
  • Thanks for the suggestions . it will be helpful if you can provide the xpath syntax i have tried it but wasn't successful. Thanks – abhishek Feb 01 '11 at 04:53