-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
26 lines (25 loc) · 782 Bytes
/
run.py
File metadata and controls
26 lines (25 loc) · 782 Bytes
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
#coding=utf-8
import sys
from openpyxl import workbook
from openpyxl import load_workbook
import sys
import getpage
reload(sys)
sys.setdefaultencoding('utf-8')
file_name = r'C:/Users/samsung/Desktop/s.xlsx'
#u_file_name = unicode(file_name,'utf-8')
#print u_file_name
#with load_workbook(filename=file_name) as f1:
s = u'微博活动一参与者汇总'
books = load_workbook(filename=file_name)
book = books.get_sheet_by_name(s)
request = getpage.http_page('http://weibo.com/u/')
for r_index in xrange(len(book.rows)):
if r_index<10:
#if book.cell(row=r_index+1,column=5).value == 'NULL':
request.get(book.cell(row=r_index+2,column=1).value)
#book.cell(row=r_index+1,column=5).value = 123
books.save(filename=file_name)
#print type(book.rows)
#print s
#print len(book.rows)