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

Method parse

proxypool/crawlers/public/xiladaili.py:15–26  ·  view source on GitHub ↗

parse html file to get proxies :return:

(self, html)

Source from the content-addressed store, hash-verified

13 urls = ["http://www.xiladaili.com/"]
14
15 def parse(self, html):
16 """
17 parse html file to get proxies
18 :return:
19 """
20 etree_html = etree.HTML(html)
21 ip_ports = etree_html.xpath("//tbody/tr/td[1]/text()")
22
23 for ip_port in ip_ports:
24 host = ip_port.partition(":")[0]
25 port = ip_port.partition(":")[2]
26 yield Proxy(host=host, port=port)
27
28
29if __name__ == '__main__':

Callers

nothing calls this directly

Calls 1

ProxyClass · 0.90

Tested by

no test coverage detected