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

Class Daili66Crawler

proxypool/crawlers/public/daili66.py:10–26  ·  view source on GitHub ↗

daili66 crawler, http://www.66ip.cn/1.html

Source from the content-addressed store, hash-verified

8
9
10class Daili66Crawler(BaseCrawler):
11 """
12 daili66 crawler, http://www.66ip.cn/1.html
13 """
14 urls = [BASE_URL.format(page=page) for page in range(1, MAX_PAGE + 1)]
15
16 def parse(self, html):
17 """
18 parse html file to get proxies
19 :return:
20 """
21 doc = pq(html)
22 trs = doc('.containerbox table tr:gt(0)').items()
23 for tr in trs:
24 host = tr.find('td:nth-child(1)').text()
25 port = int(tr.find('td:nth-child(2)').text())
26 yield Proxy(host=host, port=port)
27
28
29if __name__ == '__main__':

Callers 1

daili66.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected