-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart.py
More file actions
48 lines (40 loc) · 1.09 KB
/
start.py
File metadata and controls
48 lines (40 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# -*- coding: UTF-8 -*-
'''
Created on 2017年8月13日
@author: mlcp
'''
from Tencent import Tencent
from U17 import U17
from NetEase import NetEase
import time
from openpyxl import Workbook
from openpyxl.styles import Font, Alignment
import openpyxl
if __name__ == '__main__':
path = '/Users/mlcp/PKU/17暑假/spider/' + 'ComicsRank-' + time.strftime("%Y-%m-%d", time.localtime()) + '.xlsx'
wb = Workbook()
ws = wb.active
ws['A1'] = '腾讯'
ws['J1'] = '有妖气'
ws['T1'] = '网易漫画'
ws.merge_cells('A1:I1')
ws.merge_cells('J1:S1')
ws.merge_cells('T1:Z1')
myfont = Font(b=True)
al = Alignment(horizontal="center", vertical="center")
ws['A1'].font = myfont
ws['A1'].alignment = al
ws['J1'].font = myfont
ws['J1'].alignment = al
ws['T1'].font = myfont
ws['T1'].alignment = al
wb.save(path)
tencent = Tencent(path)
tencent.crawl()
print "腾讯完成"
u17 = U17(path)
u17.crawl()
print "有妖气完成"
netease = NetEase(path)
netease.crawl()
print "网易完成"