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

Method parse

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

parse html file to get proxies :return:

(self, html)

Source from the content-addressed store, hash-verified

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

nothing calls this directly

Calls 1

ProxyClass · 0.90

Tested by

no test coverage detected