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

Class XiladailiCrawler

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

xiladaili crawler, http://www.xiladaili.com/

Source from the content-addressed store, hash-verified

7
8
9class XiladailiCrawler(BaseCrawler):
10 """
11 xiladaili crawler, http://www.xiladaili.com/
12 """
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 1

xiladaili.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected