| 11 | |
| 12 | |
| 13 | async def run(): |
| 14 | |
| 15 | # Click on Annual button and wait for results |
| 16 | await response.html.page.click("a[data-ptype='Annual']") |
| 17 | await response.html.page.waitForSelector("table[class='genTbl reportTbl']") |
| 18 | |
| 19 | elements = await response.html.page.xpath( |
| 20 | "//*[@id='rrtable']/table//*[@id='header_row']/th/span") |
| 21 | for element in elements: |
| 22 | text = await response.html.page.evaluate('(e) => e.textContent', |
| 23 | element) |
| 24 | match = re.search(r"\d\d\d\d", text.strip()) |
| 25 | if match: |
| 26 | print(match.string) |
| 27 | |
| 28 | print("Completed...") |
| 29 | |
| 30 | |
| 31 | try: |