MCPcopy Index your code
hub / github.com/Python3WebSpider/ProxyPool / parse

Method parse

proxypool/crawlers/public/ihuan.py:17–30  ·  view source on GitHub ↗

parse html file to get proxies :return:

(self, html)

Source from the content-addressed store, hash-verified

15 ignore = False
16
17 def parse(self, html):
18 """
19 parse html file to get proxies
20 :return:
21 """
22 # doc = pq(html)('.text-left')
23 ip_address = re.compile('([\d:\.]*).*?<br>')
24 hosts_ports = ip_address.findall(html)
25 for addr in hosts_ports:
26 addr_split = addr.split(':')
27 if(len(addr_split) == 2):
28 host = addr_split[0]
29 port = addr_split[1]
30 yield Proxy(host=host, port=port)
31
32
33if __name__ == '__main__':

Callers

nothing calls this directly

Calls 1

ProxyClass · 0.90

Tested by

no test coverage detected