MCPcopy
hub / github.com/MikeChongCan/scylla / parse

Method parse

scylla/providers/a2u_provider.py:16–32  ·  view source on GitHub ↗
(self, document: PyQuery)

Source from the content-addressed store, hash-verified

14 ]
15
16 def parse(self, document: PyQuery) -> [ProxyIP]:
17 ip_list: [ProxyIP] = []
18
19 raw_html = document.html()
20
21 ip_port_str_list = re.findall(r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d{2,5}', raw_html)
22
23 for ip_port in ip_port_str_list:
24
25 ip = re.search(r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}', ip_port).group(0)
26 port = re.search(r':(\d{2,5})', ip_port).group(1)
27
28 if ip and port:
29 p = ProxyIP(ip=ip, port=port)
30 ip_list.append(p)
31
32 return ip_list
33
34 @staticmethod
35 def should_render_js() -> bool:

Callers 4

fetch_ipsFunction · 0.45
loadDataMethod · 0.45
renderPageLinkMethod · 0.45
handlePropsMethod · 0.45

Calls 1

ProxyIPClass · 0.90

Tested by

no test coverage detected