1.最笨的方法是导入配置:
from myproject.settings import MONGO_URI
from myproject.settings import MONGO_DATABASE
from myproject.settings import MONGO_COLLECTION
2.在spider里面获取settings配置:
from scrapy.conf import settings
使用方法:
driver_path = settings.get("WEBDRIVER_CHROME_PATH")
网友评论