How to extract table data of web page in matlab?

2 views (last 30 days)
How to extract web data from html table?
URL = 'http://www.mtmis.excise-punjab.gov.pk';
str = urlread(URL,'POST',{'vhlno','RIO-12-8074'});
expression = '<(table).*?</\1>';
matches = regexp(str,expression,'match')
OutPut is ::
'<table style="width: 100%">←↵ <tr>←↵ <td colspan="2"←↵ style="text-align: center;font-size: 22px;font-weight: bold;">Vehicle←↵ Details←↵ </td>←↵ </tr>←↵ <tr>←↵ <td>Registration Number:</td>←↵ <td>RIO-12-8076</td>←↵ </tr>←↵ <tr>←↵ <td>Chassis Number:</td>←↵ <td>A260576</td>←↵ </tr>←↵ <tr>←↵ <td>Engine Number:</td>←↵ <td>B260576</td>←↵ </tr>←↵ <tr>←↵ <td>Make Name:</td>←↵ <td>METRO - MR-70</td>←↵ </tr>←↵ <tr>←↵ <td>Registration Date:</td>←↵ <td>05-Nov-2012 12:00 AM</td>←↵ </tr>←↵ <tr>←↵ <td>Model:</td>←↵ <td>2012</td>←↵ </tr>←↵ <tr>←↵ <td>Vehicle Price:</td>←↵ <td>41,810</td>←↵ </tr>←↵ <tr>←↵ <td>Color:</td>←↵ <td>RED</td>←↵ </tr>←↵ <tr>←↵ <td>Token Tax Paid upto:</td>←↵ <td>January 1970</td>←↵ </tr>←↵ <tr>←↵ <td colspan="2"←↵ style="text-align: center;font-size: 22px;font-weight: bold;">Owner←↵ Details←↵ </td>←↵ </tr>←↵ <tr>←↵ <td>Owner Name</td>←↵ <td>NAJAM BUTT</td>←↵ </tr>←↵ <tr>←↵ <td>Father Name</td>←↵ <td>MUHAMMAD NAEEM</td>←↵ </tr>←↵ <tr>←↵ <td>Owner City</td>←↵ <td>RAWALPINDI</td>←↵ </tr>←↵ </table>'
How to seprate Details name, engine num, Chassis Number etc??????

Answers (0)

Products


Release

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!