MCPcopy Create free account
hub / github.com/EZ-hwh/AutoScraper / StepTree

Class StepTree

utils/html_utils.py:9–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7import tiktoken
8
9class StepTree:
10 def __init__(self, html, step_len = 5000, len_func = len):
11 self.soup = BeautifulSoup(html)
12 self.step_len = step_len
13 self.len_func = len_func
14
15 def __iter__(self):
16 if self.len_func(str(self.soup)) < self.step_len:
17 yield
18
19def find_common_ancestor(html_content:str, xpath:str):
20 try:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected