How to extract table data of web page in matlab?

조회 수: 2 (최근 30일)
Bilal qureshi
Bilal qureshi 2018년 6월 22일
댓글: Walter Roberson 2018년 6월 22일
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??????

답변 (0개)

카테고리

Help CenterFile Exchange에서 Web Services에 대해 자세히 알아보기

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by