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

Method extract_with_sequence

module/stepback_crawler.py:372–388  ·  view source on GitHub ↗
(self,
                              html_content:str,
                              sequence:str)

Source from the content-addressed store, hash-verified

370 return []
371
372 def extract_with_sequence(self,
373 html_content:str,
374 sequence:str):
375 if self.is_simplify:
376 html_content = simplify_html(html_content)
377 if sequence == []:
378 return []
379 else:
380 tot_len = len(sequence)
381 for index, xpath in enumerate(sequence):
382 if index != tot_len - 1:
383 try:
384 html_content = find_common_ancestor(html_content, xpath)
385 except:
386 pass
387 else:
388 return self.extract_with_xpath(html_content, xpath)

Callers 3

generate_sequenceMethod · 0.95
rule_synthesisMethod · 0.95
rule_synthesis_culMethod · 0.95

Calls 3

extract_with_xpathMethod · 0.95
simplify_htmlFunction · 0.90
find_common_ancestorFunction · 0.90

Tested by

no test coverage detected