Table layout extractor pattern
Hi Guys-
I have been looking over this website I have been trying to make the appropriate extractor pattern for, but a little confused on how to properly get this information. I tried using a datarecord then parsing it out via a sub-extractor, but still not a good output. In the long run I need to get this outputted to excel.
I also attached an image to you can see what the website looks like. Just change filename from .txt to .jpg
Here is the HTML code example, it is basically a table with two headers in each little table:
<td class="colspan4 rightborder" valign="top" width="25%">
<table class="ratesColumn" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="loanLabel" colspan="2" valign="top"><span>A1010</span> <br />
30 Year<br />
</td>
</tr>
<tr>
<td class="ratesLabel rightborder">Rate</td>
<td class="ratesLabel">12 BE</td>
</tr>
<tr>
<td class="ratesContent">4.500%<br />
4.625%<br />
4.750%<br />
4.875%<br />
5.000%<br />
5.125%<br />
5.250%<br />
5.375%<br />
5.500%<br />
<br />
<br />
<br />
<br />
<br />
<br />
</td>
<td class="ratesContent">1.750%<br />
1.250%<br />
0.000%<br />
-0.875%<br />
-1.250%<br />
-2.000%<br />
-2.750%<br />
-3.500%<br />
-3.625%<br />
<br />
<br />
<br />
<br />
<br />
<br />
</td>
</tr>
</table>
</td>
<td class="colspan4 rightborder" valign="top" width="25%">
<table class="ratesColumn" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="loanLabel" colspan="2" valign="top"><span>A1020</span> <br />
15 Year<br />
</td>
</tr>
<tr>
<td class="ratesLabel rightborder">Rate</td>
<td class="ratesLabel">12 BE</td>
</tr>
<tr>
<td class="ratesContent">4.000%<br />
4.125%<br />
4.250%<br />
4.375%<br />
4.500%<br />
4.625%<br />
4.750%<br />
4.875%<br />
5.000%<br />
<br />
<br />
<br />
<br />
<br />
<br />
</td>
<td class="ratesContent">1.125%<br />
0.375%<br />
-1.000%<br />
-1.750%<br />
-2.125%<br />
-2.375%<br />
-3.375%<br />
-3.625%<br />
-3.750%<br />
<br />
<br />
<br />
<br />
<br />
<br />
</td>
</tr>
</table>
</td>
<td class="colspan4 rightborder" valign="top" width="25%">
<table class="ratesColumn" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="loanLabel" colspan="2" valign="top"><span>A5019</span> <br />
Super/Conf 30<br />
</td>
</tr>
<tr>
<td class="ratesLabel rightborder">Rate</td>
<td class="ratesLabel">12 BE</td>
</tr>
<tr>
<td class="ratesContent">4.750%<br />
4.875%<br />
5.000%<br />
5.125%<br />
5.250%<br />
5.375%<br />
5.500%<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
</td>
<td class="ratesContent">1.250%<br />
0.375%<br />
0.000%<br />
-0.750%<br />
-1.500%<br />
-2.250%<br />
-2.375%<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
</td>
</tr>
</table>
</td>
<td class="colspan4 rightborder" valign="top" width="25%">
<table class="ratesColumn" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="loanLabel" colspan="2" valign="top"><span>A5029</span> <br />
Super/Conf 15<br />
</td>
</tr>
<tr>
<td class="ratesLabel rightborder">Rate</td>
<td class="ratesLabel">12 BE</td>
</tr>
<tr>
<td class="ratesContent">4.000%<br />
4.125%<br />
4.250%<br />
4.375%<br />
4.500%<br />
4.625%<br />
4.750%<br />
4.875%<br />
5.000%<br />
<br />
<br />
<br />
<br />
<br />
<br />
</td>
<td class="ratesContent">2.375%<br />
1.625%<br />
0.250%<br />
-0.500%<br />
-0.875%<br />
-1.125%<br />
-2.125%<br />
-2.375%<br />
-2.500%<br />
<br />
<br />
<br />
<br />
<br />
<br />
</td>
</tr>
</table>
</td>
</tr>
Attachment | Size |
---|---|
Preview of "Provident Funding, Ratesheet, AL".txt | 402.17 KB |
That is going to be fun to
That is going to be fun to scrape, but it can be done. You have a separate table for each box, so you make an extractor to get each table, and all of its contents. You'll then use http://community.screen-scraper.com/API/extractData to get the other parts.
Jason- I looked over the
Jason-
I looked over the extractData method. Do I need to setup an extractor pattern and then the extractData method references it in the script?
J
Jason, Yes, you would. The
Jason,
Yes, you would. The example we give may help answer your questions.
http://community.screen-scraper.com/script_repository/manual-extraction-example
-Scott