File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # 常见问题
1+ # 安装问题
22
33## 1. window下pip 安装报错
44
Original file line number Diff line number Diff line change 1+ # 运行问题
2+
3+ ## 1. 二次运行时卡住,不继续抓取
4+
5+ ![ 1779423237] ( media/1779423237.jpg )
6+
7+ 原因:因爬虫支持分布式,qu
8+
9+
Original file line number Diff line number Diff line change 1- 1.2.0
1+ 1.2.1
Original file line number Diff line number Diff line change @@ -1970,8 +1970,20 @@ def make_batch_sql(
19701970############### json相关 #######################
19711971
19721972
1973- def key2underline (key ):
1974- regex = "[A-Z]*"
1973+ def key2underline (key , strict = True ):
1974+ """
1975+ >>> key2underline("HelloWord")
1976+ 'hello_word'
1977+ >>> key2underline("SHData", strict=True)
1978+ 's_h_data'
1979+ >>> key2underline("SHData", strict=False)
1980+ 'sh_data'
1981+ >>> key2underline("SHDataHi", strict=False)
1982+ 'sh_data_hi'
1983+ >>> key2underline("SHDataHi", strict=True)
1984+ 's_h_data_hi'
1985+ """
1986+ regex = "[A-Z]*" if not strict else "[A-Z]"
19751987 capitals = re .findall (regex , key )
19761988
19771989 if capitals :
@@ -1980,7 +1992,9 @@ def key2underline(key):
19801992 continue
19811993 if pos == 0 :
19821994 if len (capital ) > 1 :
1983- key = key .replace (capital , capital .lower () + "_" , 1 )
1995+ key = key .replace (
1996+ capital , capital [:- 1 ].lower () + "_" + capital [- 1 ].lower (), 1
1997+ )
19841998 else :
19851999 key = key .replace (capital , capital .lower (), 1 )
19862000 else :
Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
22"""
3- Created on 2021-02-08 16:40:12
3+ Created on 2021-03-10 17:28:36
44---------
55@summary:
66---------
@@ -17,5 +17,5 @@ class SpiderDataItem(Item):
1717 """
1818
1919 def __init__ (self , * args , ** kwargs ):
20- # self.id = None # type : int(10) unsigned | allow_null : NO | key : PRI | default_value : None | extra : auto_increment | column_comment :
21- self .title = None # type : varchar(255) | allow_null : YES | key : | default_value : None | extra : | column_comment :
20+ # self.id = None
21+ self .title = None
You can’t perform that action at this time.
0 commit comments