You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@staticmethod
def settings(directory=None):
if directory is None:
directory = os.path.abspath(os.curdir)
os.chdir(directory)
cp = get_scrapy_cfg()
settings_mod_name = cp.get('settings', 'default')
sys.path.insert(0, directory)
settings = importlib.import_module(settings_mod_name)
data = []
for key in [key for key in dir(settings) if not key.startswith('__')]:
value = getattr(settings, key)
# `建议修改这里的取值,否则后面json.dumps(data)会报错,比如value是一个模块变量的话`
value = value if isinstance(value, (str, int, bool, dict, tuple)) else str(value)
data.append({
'key': key,
'value': value,
})
print(json.dumps(data))
The text was updated successfully, but these errors were encountered:
/usr/local/lib/python3.8/dist-packages/crawlab/core/client.py文件190行
The text was updated successfully, but these errors were encountered: