-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
36 lines (29 loc) · 1.06 KB
/
main.py
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
from selenium import webdriver
from worksheetFunctions import dataCollector
from worksheetFunctions import update
from worksheetFunctions import create
from index import indexMaker
from passwd import login
import gspread
import time
import os
#login Drive
gc = login()
#open de spreadsheet
sh = gc.open_by_url("https://docs.google.com/spreadsheets/d/1w9yC4O1-lb87pCv8kudxyJiUak4akqJvhr7LeqYKv4o/edit#gid=375195005")
##############################################################
indexList = indexMaker(sh)
##############################################################
driver = webdriver.Firefox()
k = 0
while k != len(indexList):
dataList = dataCollector(webdriver,driver,indexList[k])
if len(dataList[4]) > 100:
dataList[4] = dataList[4][:100]
if dataList[4] not in str(sh.worksheets()):
create(dataList[4], sh, dataList[0], dataList[1],dataList[2], dataList[3],indexList[k])
k+=1
driver.close()
##############################################################
#update
##############################################################