Exemple #1
0
def questionQnaParser4(startId, endId):
    for questionId in range(startId, endId):
        success = False
        while (success == False):
            try:
                parsedQuestion = parser.getParsedQuestion(questionId)
                if (parsedQuestion != None):
                    json_writer.writeJSONtoFile(mrJason4, parsedQuestion)
                success = True
            except:
                print("Упс ошибочка\tпроцесс: 4\tпарсинг вопроса: {0:d}".format(questionId))
                time.sleep(4)
Exemple #2
0
def usersQnaParser4():
    import csv
    with open(userBlock4, "r", encoding="utf-8") as r_file:
        reader = csv.reader(r_file, delimiter="\t")
        for i in reader:
            success = False
            while (success == False):
                try:
                    parsedUsers = user_parser.getUserInfo(i)
                    if (parsedUsers != None):
                        json_writer.writeJSONtoFile(mrsJason4, parsedUsers)
                    success = True
                except:
                    print('Упс ошибочка\tпроцесс: 4\tпарсинг пользователя: ' + i[0])
                    time.sleep(7)