| 22 | |
| 23 | |
| 24 | class Tool: |
| 25 | rma = re.compile('<a href=.*?>|</a>') |
| 26 | rmtb = re.compile('<br />|</br>|<br>') |
| 27 | rmtr = re.compile('<td>|</td>|<tr>|</tr>|<tr class="alt">|<tr class="datelisthead">') |
| 28 | rmtime1 = re.compile('<td align="Center" width="7%">.*?</td>') |
| 29 | rmtime2 = re.compile('<td class="noprint" align="Center".*?>.*?</td>') |
| 30 | |
| 31 | def replace(self, x): |
| 32 | x = re.sub(self.rma, ' ', x) |
| 33 | x = re.sub(self.rmtb, '---', x) |
| 34 | x = re.sub(self.rmtr, ' ', x) |
| 35 | x = re.sub(self.rmtime1, '\n', x) |
| 36 | x = re.sub(self.rmtime2, '', x) |
| 37 | return x.strip() |
| 38 | |
| 39 | |
| 40 | def Getgrade(response): |