################################# ################################# try: sFile = bText fileData = "" sFile = reFile.findall(sFile) for inc in range(len(sFile)): sFile[inc] = "https://com.roseltorg.ru/file/get/t/LotDocuments/id" + sFile[inc] for fil in sFile : fileData = fileData + saveFile(fil,True) except: fileData = "" ################################# ################################# sPrice = sPrice.replace("<strong>", "") sPrice = sPrice.replace("</strong>", "") sNameOrg = sNameOrg.replace("<strong>", "") sNameOrg = sNameOrg.replace("</strong>", "") sNameRus = sNameRus.replace("<strong>", "") sNameRus = sNameRus.replace("</strong>", "") sOrg = sOrg.replace("<strong>", "") sOrg = sOrg.replace("</strong>", "")
sCat = sCat.replace("/", " ") sCat = sCat.replace("product", " ") sCat = sCat.replace(" ", " ") sCat = sCat.replace(" ", " ") sCat = sCat.replace(" ", " ") sCat = sCat.replace(" ", " ") sCat = sCat.replace(" ", " ") sCat = sCat.replace(" ", " ") sCat = sCat.replace(" ", " ") sCat = sCat.strip() fileData = "" for x in range(len(sFile)) : fileData = fileData + saveFile("http://zakupki.gov.ru/pgz/documentdownload?documentId=" + sFile[x],False) fileDataBuff = fileData.split(";") fileDataBuff = dict().fromkeys(fileDataBuff).keys() fileData = "" for line in fileDataBuff : if line != "" : fileData = fileData + line + ";" Log(sId,sPrice,sTime,sNameOrg.strip(),sNameRus.strip(),sOrg.strip(),sRegId,sAdress.strip(),sCat.strip(),fileData,sSite,sLink) Insert(sId,sPrice,sTime,sNameOrg.strip(),sNameRus.strip(),sOrg.strip(),sRegId,sAdress.strip(),sCat.strip(),fileData,sSite,sLink) time.sleep(0.5) if time.time() - STARTIME > LIVETIME : os.abort()