MCPcopy Create free account
hub / github.com/alpha2phi/python-apps / run

Function run

dynamic-web-scraping/req_html.py:13–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12
13async 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
31try:

Callers 1

req_html.pyFile · 0.85

Calls 1

evaluateMethod · 0.45

Tested by

no test coverage detected