DoubanBookSpider/DoubanSpider/__init__.py

33 lines
734 B
Python
Raw Normal View History

2019-09-06 18:31:51 +08:00
import os
# 环境检查
try:
from sqlalchemy import create_engine, Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
2019-09-10 20:58:12 +08:00
import random
2019-09-06 18:31:51 +08:00
import re
import time
import csv
2019-09-10 20:58:12 +08:00
import requests
import time
2019-09-06 18:31:51 +08:00
import sqlite3
import logging
except:
print('[System]正在安装支持库...')
2019-09-10 20:58:12 +08:00
os.system(r'pip install -r .\DoubanSpider\requirements.txt')
2019-09-06 18:31:51 +08:00
from sqlalchemy import create_engine, Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
2019-09-10 20:58:12 +08:00
import random
import re
import time
import csv
import requests
import time
import sqlite3
import logging
finally:
print('[System]运行库加载完毕!')