parse html file to get proxies :return:
(self, html)
| 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__': |