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

Class Ip89Crawler

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

89ip crawler, http://api.89ip.cn

Source from the content-addressed store, hash-verified

7
8
9class Ip89Crawler(BaseCrawler):
10 """
11 89ip crawler, http://api.89ip.cn
12 """
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 1

ip89.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected