seo方法 crawler, https://proxy.seofangfa.com/
| 10 | |
| 11 | |
| 12 | class SeoFangFaCrawler(BaseCrawler): |
| 13 | """ |
| 14 | seo方法 crawler, https://proxy.seofangfa.com/ |
| 15 | """ |
| 16 | urls = ["https://proxy.seofangfa.com/"] |
| 17 | |
| 18 | def parse(self, html): |
| 19 | """ |
| 20 | parse html file to get proxies |
| 21 | :return: |
| 22 | """ |
| 23 | doc = pq(html) |
| 24 | trs = doc('.table tr:gt(0)').items() |
| 25 | for tr in trs: |
| 26 | host = tr.find('td:nth-child(1)').text() |
| 27 | port = int(tr.find('td:nth-child(2)').text()) |
| 28 | yield Proxy(host=host, port=port) |
| 29 | |
| 30 | |
| 31 | if __name__ == '__main__': |