Content-Length: 268408 | pFad | http://github.com/cwjokaka/ok_ip_proxy_pool/commit/1f396575b51b3dfeb24e84883edb049649568bf5

C5 add: 爬虫注册器 · cwjokaka/ok_ip_proxy_pool@1f39657 · GitHub
Skip to content

Commit

Permalink
add: 爬虫注册器
Browse files Browse the repository at this point in the history
  • Loading branch information
cwjokaka committed Sep 9, 2019
1 parent c6f5640 commit 1f39657
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
6 changes: 1 addition & 5 deletions setting.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# from src.spider.spider_66_ip import Spider66Ip
# from src.spider.spider_quan_wang_ip import SpiderQuanWangIp
from src.database.memory_db import *

DB = {
'db_typy': 'memory' # memory/redis
}

# SPIDER_LIST = [Spider66Ip, SpiderQuanWangIp]
SPIDER_LIST = ['Spider66Ip', 'SpiderQuanWangIp', 'SpiderXiciIp']


# 爬虫请求头
Expand Down
9 changes: 8 additions & 1 deletion src/spider/spider_quan_wang_ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
from src.spider.abs_spider import AbsSpider
from bs4 import BeautifulSoup, Tag

from src.spider.spider_register import spider_register


@spider_register
class SpiderQuanWangIp(AbsSpider):
"""
全网IP代理爬虫 刷新速度:极快
Expand Down Expand Up @@ -84,4 +87,8 @@ def _judge_proxy_cover(self, cover_str: str):
elif cover_str == '高匿':
return ProxyCoverEnum.HIGH_COVER
else:
return ProxyCoverEnum.UNKNOWN
return ProxyCoverEnum.UNKNOWN


if __name__ == '__main__':
pass
7 changes: 7 additions & 0 deletions src/spider/spider_register.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
spider_collection = {}


def spider_register(cls):
spider_collection.update({cls.__name__: cls})
print(f'注册{cls.__name__}')
return cls

0 comments on commit 1f39657

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/cwjokaka/ok_ip_proxy_pool/commit/1f396575b51b3dfeb24e84883edb049649568bf5

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy