MCPcopy Create free account
hub / github.com/Python3WebSpider/ProxyPool / parse

Method parse

proxypool/crawlers/public/ip89.py:15–27  ·  view source on GitHub ↗

parse html file to get proxies :return:

(self, html)

Source from the content-addressed store, hash-verified

13 urls = [BASE_URL]
14
15 def parse(self, html):
16 """
17 parse html file to get proxies
18 :return:
19 """
20 ip_address = re.compile('([\d:\.]*)<br>')
21 hosts_ports = ip_address.findall(html)
22 for addr in hosts_ports:
23 addr_split = addr.split(':')
24 if(len(addr_split) == 2):
25 host = addr_split[0]
26 port = addr_split[1]
27 yield Proxy(host=host, port=port)
28
29
30if __name__ == '__main__':

Callers

nothing calls this directly

Calls 1

ProxyClass · 0.90

Tested by

no test coverage detected