MCPcopy
hub / github.com/alirezamika/autoscraper / _get_valid_attrs

Method _get_valid_attrs

autoscraper/auto_scraper.py:125–134  ·  view source on GitHub ↗
(item)

Source from the content-addressed store, hash-verified

123
124 @staticmethod
125 def _get_valid_attrs(item):
126 key_attrs = {"class", "style"}
127 attrs = {
128 k: v if v != [] else "" for k, v in item.attrs.items() if k in key_attrs
129 }
130
131 for attr in key_attrs:
132 if attr not in attrs:
133 attrs[attr] = ""
134 return attrs
135
136 @staticmethod
137 def _child_has_text(child, text, url, text_fuzz_ratio):

Callers 1

_build_stackMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected