MCPcopy
hub / github.com/scrapy/scrapy / _compile_regexes

Method _compile_regexes

scrapy/linkextractors/lxmlhtml.py:211–215  ·  view source on GitHub ↗
(value: _RegexOrSeveral | None)

Source from the content-addressed store, hash-verified

209
210 @staticmethod
211 def _compile_regexes(value: _RegexOrSeveral | None) -> list[re.Pattern[str]]:
212 return [
213 x if isinstance(x, re.Pattern) else re.compile(x)
214 for x in arg_to_iter(value)
215 ]
216
217 def _link_allowed(self, link: Link) -> bool:
218 if not _is_valid_url(link.url):

Callers 1

__init__Method · 0.95

Calls 1

arg_to_iterFunction · 0.90

Tested by

no test coverage detected