parse html file to get proxies :return:
(self, html)
| 35 | self.urls = [] |
| 36 | |
| 37 | def parse(self, html): |
| 38 | """ |
| 39 | parse html file to get proxies |
| 40 | :return: |
| 41 | """ |
| 42 | doc = pq(html) |
| 43 | contents = doc('.cont').text() |
| 44 | contents = contents.split("\n") |
| 45 | for content in contents: |
| 46 | c = content[:content.find("@")] |
| 47 | host, port = c.split(":") |
| 48 | yield Proxy(host=host, port=int(port)) |
| 49 | |
| 50 | |
| 51 | if __name__ == '__main__': |