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

Class XicidailiCrawler

proxypool/crawlers/public/xicidaili.py:9–29  ·  view source on GitHub ↗

xididaili crawler, https://www.xicidaili.com/

Source from the content-addressed store, hash-verified

7
8
9class XicidailiCrawler(BaseCrawler):
10 """
11 xididaili crawler, https://www.xicidaili.com/
12 """
13 urls = [BASE_URL]
14 ignore = True
15
16 def parse(self, html):
17 """
18 parse html file to get proxies
19 :return:
20 """
21 doc = pq(html)
22 items = doc('#ip_list tr:contains(高匿)').items()
23 for item in items:
24 country = item.find('td.country').text()
25 if not country or country.strip() != '高匿':
26 continue
27 host = item.find('td:nth-child(2)').text()
28 port = int(item.find('td:nth-child(3)').text())
29 yield Proxy(host=host, port=port)
30
31
32if __name__ == '__main__':

Callers 1

xicidaili.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected