- Я получаю электронные письма из API GMAIL.
- У меня есть содержимое для каждого письма.
- Мне нужно извлечь некоторый контент в этом html.Но этот html полон таблицы, у него нет идентификаторов или классов для селектора.
<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-8">
<meta name=3D"viewport" content=3D"width=3Ddevice-width, initial-scale=3D= 1.0">
<meta name=3D"viewport" content=3D"width=3Ddevice-width, initial-scale=3D= 1, maximum-scale=3D1">
</head>
<body style=3D"font-family: 'Source Sans Pro',sans-serif;background-color: = #dfdfdf;padding: 15px;margin: 0;font-size: 1px;mso-line-height-alt: 0;line-= height: 0;mso-margin-top-alt: 1px;">
<table style=3D"border-collapse: collapse;color: #5a5a5a;font-size: 14px;= -ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;width: 100%">
<tr style=3D"font-size: 14px;line-height: 21px;text-align: left;vertica= l-align: top;">
<td></td>
<td style=3D"color: #5a5a5a;font-size: 14px;line-height: 21px;text-al= ign: left;vertical-align: top;width: 960px;min-width: 520px;border: 1px sol= id #5a5a5a;padding: 20px;background: #ffffff;">
<table style=3D"border-collapse: collapse;">
<tr style=3D"font-size: 14px;line-height: 21px;text-align: left;v= ertical-align: top;">
<td style=3D"color: #5a5a5a;font-size: 14px;line-height: 21px;v= ertical-align: middle;">
<table style=3D"border-collapse: collapse;width: 100%;border-= bottom: 2px solid #ebebeb;">
<tr>
<td style=3D"height: 82px;text-align: center;vertical-ali= gn: middle;font-weight: 300;font-size:32px;padding-bottom:16px;font-family:= 'Source Sans Pro',sans-serif;color: #5a5a5a;"> Email Archive Status Report </td>
</tr>
</table>
<table style=3D"border-collapse: collapse;line-height: 21px;t= ext-align: left;vertical-align: top;height: auto;margin: 0 20px 20px 0;">
<tr style=3D"font-size: 14px;line-height: 21px;text-align: = left;vertical-align: top;">
<td style=3D"color: #5a5a5a;font-size: 14px;line-height: = 21px;text-align: left;vertical-align: top;">
<table style=3D"border-collapse: collapse;font-size: 14= px;margin: 10px 10px 0 10px;width: 100%;">
<tr style=3D"font-size: 14px;vertical-align: top;">
<td style=3D"color: #5a5a5a;font-family: 'Source Sa= ns Pro',sans-serif;font-size: 14px;line-height: 21px;text-align: left;verti= cal-align: top;width: 50%;margin-right: 10px;">
<div style=3D"color: #e65f1e;border-bottom: 1px s= olid #ebebeb;font-size: 18px;padding: 0 3px 0 3px;margin-bottom: 4px;line-h= eight: 36px;height: 30px;margin-right: 20px;">License</div>
<table style=3D"border-collapse: collapse;">
<tr style=3D"font-size: 14px;vertical-align: to= p;">
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;text-align: left;vertical-align: t= op;line-height: 21px;padding-bottom:0;max-width: 270px;overflow: hidden;whi= te-space: nowrap;padding-right: 50px;">Archives</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;text-align: left;vertical-align: t= op;line-height: 21px;padding-bottom:0;">7 archives</td>
</tr>
</table>
</td>
<td style=3D"color: #5a5a5a;font-family: 'Source Sa= ns Pro',sans-serif;font-size: 14px;line-height: 21px;text-align: left;verti= cal-align: top;width: 50%;margin-left: 10px;">
<div style=3D"color: #e65f1e;border-bottom: 1px s= olid #ebebeb;font-size: 18px;padding: 0 3px 0 3px;margin-bottom: 4px;line-h= eight: 36px;height: 30px;margin-right: 20px;">Instance</div>
<table style=3D"border-collapse: collapse;">
<tr style=3D"font-size: 14px;vertical-align: to= p;">
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;text-align: left;vertical-align: t= op;line-height: 21px;padding-bottom:0;max-width: 270px;overflow: hidden;whi= te-space: nowrap;padding-right: 50px;">Instance Name</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;text-align: left;vertical-align: t= op;line-height: 21px;padding-bottom:0;">k477931430</td>
</tr>
<tr style=3D"font-size: 14px;vertical-align: to= p;">
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;text-align: left;vertical-align: t= op;line-height: 21px;padding-bottom:0;max-width: 270px;overflow: hidden;whi= te-space: nowrap;padding-right: 50px;">Version</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;text-align: left;vertical-align: t= op;line-height: 21px;padding-bottom:0;">11.2.1.14113 (64-bit; Build Date 1/= 14/2019)</td>
</tr>
</table>
</td>
</tr>
</table>
<table style=3D"border-collapse: collapse;font-size: 14= px;margin: 10px 10px 0 10px;width: 100%;">
<tr style=3D"font-size: 14px;vertical-align: top;">
<td style=3D"color: #5a5a5a;font-family: 'Source Sa= ns Pro',sans-serif;font-size: 14px;line-height: 21px;text-align: left;verti= cal-align: top;width: 50%;margin-right: 10px;">
<div style=3D"color: #e65f1e;border-bottom: 1px s= olid #ebebeb;font-size: 18px;padding: 0 3px 0 3px;margin-bottom: 4px;line-h= eight: 36px;height: 30px;margin-right: 20px;">Archive</div>
<table style=3D"border-collapse: collapse;">
<tr style=3D"font-size: 14px;vertical-align: to= p;">
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;text-align: left;vertical-align: t= op;line-height: 21px;padding-bottom:0;max-width: 270px;overflow: hidden;whi= te-space: nowrap;padding-right: 50px;">Total Size</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;text-align: left;vertical-align: t= op;line-height: 21px;padding-bottom:0;">538,782 messages</td>
</tr>
<tr style=3D"font-size: 14px;vertical-align: to= p;">
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;text-align: left;vertical-align: t= op;line-height: 21px;padding-bottom:0;max-width: 270px;overflow: hidden;whi= te-space: nowrap;padding-right: 50px;">Newly Archived
<span style=3D"font-s= ize: 10px;">(2/12/2019)</span>
</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;text-align: left;vertical-align: t= op;line-height: 21px;padding-bottom:0;">276 messages</td>
</tr>
</table>
</td>
<td style=3D"color: #5a5a5a;font-family: 'Source Sa= ns Pro',sans-serif;font-size: 14px;line-height: 21px;text-align: left;verti= cal-align: top;width: 50%;margin-left: 10px;">
<div style=3D"color: #e65f1e;border-bottom: 1px s= olid #ebebeb;font-size: 18px;padding: 0 3px 0 3px;margin-bottom: 4px;line-h= eight: 36px;height: 30px;margin-right: 20px;">Compliance</div>
<table style=3D"border-collapse: collapse;">
<tr style=3D"font-size: 14px;vertical-align: to= p;">
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;text-align: left;vertical-align: t= op;line-height: 21px;padding-bottom:0;max-width: 270px;overflow: hidden;whi= te-space: nowrap;padding-right: 50px;">Service Provider Access</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;text-align: left;vertical-align: t= op;line-height: 21px;padding-bottom:0;">Enabled</td>
</tr>
<tr style=3D"font-size: 14px;vertical-align: to= p;">
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;text-align: left;vertical-align: t= op;line-height: 21px;padding-bottom:0;max-width: 270px;overflow: hidden;whi= te-space: nowrap;padding-right: 50px;">Archive Access by Admin</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;text-align: left;vertical-align: t= op;line-height: 21px;padding-bottom:0;">Enabled</td>
</tr>
<tr style=3D"font-size: 14px;vertical-align: to= p;">
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;text-align: left;vertical-align: t= op;line-height: 21px;padding-bottom:0;max-width: 270px;overflow: hidden;whi= te-space: nowrap;padding-right: 50px;">Retention Policies</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;text-align: left;vertical-align: t= op;line-height: 21px;padding-bottom:0;">Total: 0 / Enabled: 0 / Automatic D= eletion: 0</td>
</tr>
<tr style=3D"font-size: 14px;vertical-align: to= p;">
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;text-align: left;vertical-align: t= op;line-height: 21px;padding-bottom:0;max-width: 270px;overflow: hidden;whi= te-space: nowrap;padding-right: 50px;">Legal Hold</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;text-align: left;vertical-align: t= op;line-height: 21px;padding-bottom:0;">Disabled</td>
</tr>
<tr style=3D"font-size: 14px;vertical-align: to= p;">
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;text-align: left;vertical-align: t= op;line-height: 21px;padding-bottom:0;max-width: 270px;overflow: hidden;whi= te-space: nowrap;padding-right: 50px;">Auditing</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;text-align: left;vertical-align: t= op;line-height: 21px;padding-bottom:0;">17 event types of 28</td>
</tr>
</table>
</td>
</tr>
</table>
<table style=3D"border-collapse: collapse;font-size: 14= px;margin: 10px 10px 0 10px;width: 100%;">
<tr style=3D"font-size: 14px;line-height: 21px;text-a= lign: left;vertical-align: top;">
<td style=3D"color: #5a5a5a;font-family: 'Source Sa= ns Pro',sans-serif;font-size: 14px;line-height: 21px;text-align: left;verti= cal-align: top;">
<div style=3D"color: #e65f1e;border-bottom: 1px s= olid #ebebeb;font-size: 18px;padding: 0 3px 0 3px;margin-bottom: 4px;line-h= eight: 36px;height: 30px;"> Archiving Statistics
<span style=3D"font-size: = 12px;">(2/12/2019)</span>
</div>
<table style=3D"border-collapse: collapse;width: = 100%;">
<tr style=3D"vertical-align: top;mso-line-heigh= t-alt: 22px;line-height: 22px;">
<th style=3D"font-size: 14px;vertical-align: = top;font-family: 'Source Sans Pro',sans-serif;line-height: normal;padding: = 4px 8px;white-space: nowrap;background-color: #505050;color: #ffffff;font-w= eight: normal;text-align: left;width: 48%;">Name</th>
<th style=3D"font-size: 14px;vertical-align: = top;font-family: 'Source Sans Pro',sans-serif;line-height: normal;padding: = 4px 8px;white-space: nowrap;background-color: #505050;color: #ffffff;font-w= eight: normal;text-align: right;width: 11%;">Successful</th>
<th style=3D"font-size: 14px;vertical-align: = top;font-family: 'Source Sans Pro',sans-serif;line-height: normal;padding: = 4px 8px;white-space: nowrap;background-color: #505050;color: #ffffff;font-w= eight: normal;text-align: right;width: 11%;">Failed</th>
<th style=3D"font-size: 14px;vertical-align: = top;font-family: 'Source Sans Pro',sans-serif;line-height: normal;padding: = 4px 8px;white-space: nowrap;background-color: #505050;color: #ffffff;font-w= eight: normal;text-align: left;width: 19%;">Last Execution</th>
<th style=3D"font-size: 14px;vertical-align: = top;font-family: 'Source Sans Pro',sans-serif;line-height: normal;padding: = 4px 8px;white-space: nowrap;background-color: #505050;color: #ffffff;font-w= eight: normal;text-align: center;width: 11%;">Last Result</th>
</tr>
<tr style=3D"font-size: 14px;text-align: left;l= ine-height: 21px;vertical-align: top;">
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: left;padding: 1px 8px;">vachonsecure.fr Charles</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: right;padding: 1px 8px;">210</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: right;padding: 1px 8px;">0</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: left;padding: 1px 8px;">2/12/2019 11:53:42 PM</td>
<td style=3D"font-weight: bold;color: green;f= ont-family: 'Source Sans Pro',sans-serif;font-size: 14px;line-height: 21px;= vertical-align: top;text-align: center;padding: 0 8px;">Succeeded</td>
</tr>
<tr style=3D"font-size: 14px;text-align: left;l= ine-height: 21px;vertical-align: top;">
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: left;padding: 1px 8px;">bs-technology.fr Eric</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: right;padding: 1px 8px;">133</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: right;padding: 1px 8px;">0</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: left;padding: 1px 8px;">2/12/2019 11:48:20 PM</td>
<td style=3D"font-weight: bold;color: green;f= ont-family: 'Source Sans Pro',sans-serif;font-size: 14px;line-height: 21px;= vertical-align: top;text-align: center;padding: 0 8px;">Succeeded</td>
</tr>
<tr style=3D"font-size: 14px;text-align: left;l= ine-height: 21px;vertical-align: top;">
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: left;padding: 1px 8px;">boxalacarte.com Eric</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: right;padding: 1px 8px;">244</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: right;padding: 1px 8px;">0</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: left;padding: 1px 8px;">2/12/2019 11:53:42 PM</td>
<td style=3D"font-weight: bold;color: green;f= ont-family: 'Source Sans Pro',sans-serif;font-size: 14px;line-height: 21px;= vertical-align: top;text-align: center;padding: 0 8px;">Succeeded</td>
</tr>
<tr style=3D"font-size: 14px;text-align: left;l= ine-height: 21px;vertical-align: top;">
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: left;padding: 1px 8px;">pascapascal.bovero
<img style=3D"dis= play: none;" />@uniic.org
</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: right;padding: 1px 8px;">161</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: right;padding: 1px 8px;">0</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: left;padding: 1px 8px;">2/12/2019 11:54:10 PM</td>
<td style=3D"font-weight: bold;color: green;f= ont-family: 'Source Sans Pro',sans-serif;font-size: 14px;line-height: 21px;= vertical-align: top;text-align: center;padding: 0 8px;">Succeeded</td>
</tr>
<tr style=3D"font-size: 14px;text-align: left;l= ine-height: 21px;vertical-align: top;">
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: left;padding: 1px 8px;">bs-technology.fr Info</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: right;padding: 1px 8px;">265</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: right;padding: 1px 8px;">0</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: left;padding: 1px 8px;">2/12/2019 11:59:03 PM</td>
<td style=3D"font-weight: bold;color: green;f= ont-family: 'Source Sans Pro',sans-serif;font-size: 14px;line-height: 21px;= vertical-align: top;text-align: center;padding: 0 8px;">Succeeded</td>
</tr>
</table>
</td>
</tr>
</table>
<table style=3D"border-collapse: collapse;font-size: 14= px;margin: 10px 10px 0 10px;width: 100%;">
<tr style=3D"font-size: 14px;line-height: 21px;text-a= lign: left;vertical-align: top;">
<td style=3D"color: #5a5a5a;font-family: 'Source Sa= ns Pro',sans-serif;font-size: 14px;line-height: 21px;text-align: left;verti= cal-align: top;">
<div style=3D"color: #e65f1e;border-bottom: 1px s= olid #ebebeb;font-size: 18px;padding: 0 3px 0 3px;margin-bottom: 4px;line-h= eight: 36px;height: 30px;"> Jobs
<span style=3D"font-size: 12px;">(2/12/201= 9)</span>
</div>
<table style=3D"border-collapse: collapse;">
<tr style=3D"color: #5a5a5a;font-family: 'Sourc= e Sans Pro',sans-serif;font-size: 14px;text-align: left;line-height: 21px;v= ertical-align: top;">
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;text-align: left;vertical-align: top;font-size: 12= px;line-height: 16px;padding-bottom: 10px;">
<b>Important Notice:</b> The last result on= ly represents the status of the job execution itself but does not necessari= ly correspond to the result of the command executed by this job. To access = the output of the executed command, go to
<em>Administrative Tools > Man= agement API > Job Results</em> in the client and double-click on the res= pective entry.
</td>
</tr>
</table>
<table style=3D"border-collapse: collapse;width: = 100%;">
<tr style=3D"vertical-align: top;mso-line-heigh= t-alt: 22px;line-height: 22px;">
<th style=3D"font-size: 14px;vertical-align: = top;font-family: 'Source Sans Pro',sans-serif;line-height: normal;padding: = 4px 8px;white-space: nowrap;background-color: #505050;color: #ffffff;font-w= eight: normal;text-align: left;width: 48%;">Name</th>
<th style=3D"font-size: 14px;vertical-align: = top;font-family: 'Source Sans Pro',sans-serif;line-height: normal;padding: = 4px 8px;white-space: nowrap;background-color: #505050;color: #ffffff;font-w= eight: normal;text-align: right;width: 11%;">Successful</th>
<th style=3D"font-size: 14px;vertical-align: = top;font-family: 'Source Sans Pro',sans-serif;line-height: normal;padding: = 4px 8px;white-space: nowrap;background-color: #505050;color: #ffffff;font-w= eight: normal;text-align: right;width: 11%;">Failed</th>
<th style=3D"font-size: 14px;vertical-align: = top;font-family: 'Source Sans Pro',sans-serif;line-height: normal;padding: = 4px 8px;white-space: nowrap;background-color: #505050;color: #ffffff;font-w= eight: normal;text-align: left;width: 19%;">Last Execution</th>
<th style=3D"font-size: 14px;vertical-align: = top;font-family: 'Source Sans Pro',sans-serif;line-height: normal;padding: = 4px 8px;white-space: nowrap;background-color: #505050;color: #ffffff;font-w= eight: normal;text-align: center;width: 11%;">Last Result</th>
</tr>
<tr style=3D"font-size: 14px;text-align: left;l= ine-height: 21px;vertical-align: top;">
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: left;padding: 1px 8px;">Envoyer le rapport de statut</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: right;padding: 1px 8px;">1</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: right;padding: 1px 8px;">0</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: left;padding: 1px 8px;">2/12/2019 5:30:02 AM</td>
<td style=3D"font-weight: bold;color: green;f= ont-family: 'Source Sans Pro',sans-serif;font-size: 14px;line-height: 21px;= vertical-align: top;text-align: center;padding: 0 8px;">Succeeded</td>
</tr>
<tr style=3D"font-size: 14px;text-align: left;l= ine-height: 21px;vertical-align: top;">
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: left;padding: 1px 8px;">Process Retention Policies</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: right;padding: 1px 8px;">1</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: right;padding: 1px 8px;">0</td>
<td style=3D"color: #5a5a5a;font-family: 'Sou= rce Sans Pro',sans-serif;font-size: 14px;line-height: 21px;vertical-align: = top;text-align: left;padding: 1px 8px;">2/12/2019 3:30:00 AM</td>
<td style=3D"font-weight: bold;color: green;f= ont-family: 'Source Sans Pro',sans-serif;font-size: 14px;line-height: 21px;= vertical-align: top;text-align: center;padding: 0 8px;">Succeeded</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div style=3D"height: 30px;border-top: 1px solid #e5e5e5;marg= in: 5px;color: #999999;mso-line-height-alt: 18px;mso-margin-top-alt: 18px;l= ine-height: 18px;font-size: 11px;">
<div style=3D"text-align: left;">
<span style=3D"font-size: 11px;mso-line-height-alt: 18px;= line-height: 18px;mso-margin-top-alt: 18px;color: #5a5a5a;text-align: left;= vertical-align: top;font-family: 'Source Sans Pro',sans-serif;">
</spa= n>
</div>
</div>
</td>
</tr>
</table>
</td>
<td></td>
</tr>
</table>
</body>
В этой строке я хотел бы извлечь некоторые данные, такие как электронные письма и дату.Это не самые сложные вещи здесь.Все почтовые адреса не такие, как
"johndoe@gmail.com"
, это может быть, но большая часть почтового адреса похожа на
xxx.fr Charles
Сначала я попытался извлечь html, а затем с XPathполучить контент, который я хочу.Но проблема в том, что когда я выбираю только "// tr", как узнать, какая строка является адресом, другая - местоположением или что-то еще
Вот мой код:
$message_id = $lm->id;
$thread_id = $lm->threadId;
$optParamsGet2['format'] = 'raw';
$single_message = $gmail->users_messages->get('me', $message_id, $optParamsGet2);
$body = base64url_decode($single_message->raw);
$string = preg_replace('~[[:cntrl:]]~', " ", $body);
$rawString = strip_tags(preg_replace('/\s+/', '', $string));
$html = get_string_between($string, "<!DOCTYPE html>", "</html>");
libxml_use_internal_errors(true) AND libxml_clear_errors();
$doc = new DOMDocument();
$doc->preserveWhiteSpace = false;
$doc->loadHTML($html);
$xpath = new DOMXpath($doc);
$nodes = $xpath->query("//tr");
У вас есть несколько советов?
РЕДАКТИРОВАТЬ:
Я пробовал решение @Anthony Harley, это результат ссылка .Я использую регулярное выражение, чтобы извлечь начало, но для адреса, я не мог.В Индексе 10 таблицы я хочу извлечь имя, дату и, если это удастся.Но это не тот же шаблон для каждого пользователя.