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

Method parse

proxypool/crawlers/public/docip.py:18–32  ·  view source on GitHub ↗

parse html file to get proxies :return:

(self, html)

Source from the content-addressed store, hash-verified

16 urls = [BASE_URL.format(date=time.strftime("%Y%m%d", time.localtime()))]
17
18 def parse(self, html):
19 """
20 parse html file to get proxies
21 :return:
22 """
23 try:
24 result = json.loads(html)
25 proxy_list = result['data']
26 for proxy_item in proxy_list:
27 host = proxy_item['ip']
28 port = host.split(':')[-1]
29 yield Proxy(host=host, port=port)
30 except json.JSONDecodeError:
31 print("json.JSONDecodeError")
32 return
33
34
35if __name__ == '__main__':

Callers

nothing calls this directly

Calls 1

ProxyClass · 0.90

Tested by

no test coverage detected