data5u crawler, http://www.data5u.com
| 7 | |
| 8 | |
| 9 | class Data5UCrawler(BaseCrawler): |
| 10 | """ |
| 11 | data5u crawler, http://www.data5u.com |
| 12 | """ |
| 13 | urls = [BASE_URL] |
| 14 | |
| 15 | def parse(self, html): |
| 16 | """ |
| 17 | parse html file to get proxies |
| 18 | :return: |
| 19 | """ |
| 20 | doc = pq(html) |
| 21 | items = doc('.wlist ul.l2').items() |
| 22 | for item in items: |
| 23 | host = item.find('span:first-child').text() |
| 24 | port = int(item.find('span:nth-child(2)').text()) |
| 25 | yield Proxy(host=host, port=port) |
| 26 | |
| 27 | |
| 28 | if __name__ == '__main__': |