mirror of
https://github.com/ail-project/ail-framework.git
synced 2025-09-06 23:22:39 +00:00
chg: [crawler] submit free text of urls to crawl
This commit is contained in:
parent
9d26a47c17
commit
1505bf0157
4 changed files with 94 additions and 21 deletions
|
@ -7,7 +7,6 @@ Regex Helper
|
|||
|
||||
import os
|
||||
import logging.config
|
||||
import phonenumbers
|
||||
import re
|
||||
import sys
|
||||
import uuid
|
||||
|
@ -20,7 +19,6 @@ sys.path.append(os.environ['AIL_BIN'])
|
|||
##################################
|
||||
from lib import ail_logger
|
||||
from lib import ConfigLoader
|
||||
# from lib import Statistics
|
||||
|
||||
logging.config.dictConfig(ail_logger.get_config())
|
||||
logger = logging.getLogger()
|
||||
|
@ -171,6 +169,7 @@ def regex_search(r_key, regex, item_id, content, max_time=30):
|
|||
|
||||
## Phone Regexs ##
|
||||
def _regex_phone_iter(r_key, country_code, content):
|
||||
import phonenumbers
|
||||
iterator = phonenumbers.PhoneNumberMatcher(content, country_code)
|
||||
for match in iterator:
|
||||
value = match.raw_string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue