MCPcopy Index your code
hub / github.com/grapeot/devin.cursorrules / should_skip_element

Function should_skip_element

tools/web_scraper.py:49–58  ·  view source on GitHub ↗

Check if the element should be skipped.

(elem)

Source from the content-addressed store, hash-verified

47 seen_texts = set() # To avoid duplicates
48
49 def should_skip_element(elem) -> bool:
50 """Check if the element should be skipped."""
51 # Skip script and style tags
52 if elem.tag in ['{http://www.w3.org/1999/xhtml}script',
53 '{http://www.w3.org/1999/xhtml}style']:
54 return True
55 # Skip empty elements or elements with only whitespace
56 if not any(text.strip() for text in elem.itertext()):
57 return True
58 return False
59
60 def process_element(elem, depth=0):
61 """Process an element and its children recursively."""

Callers 1

process_elementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected