T
T
TrafaR3T2021-07-24 07:46:14
Python
TrafaR3T, 2021-07-24 07:46:14

How to make the program work further when an error occurs?

https://pastebin.com/qs7jW7gU I made a parser, it is necessary that when an error occurs, the parser ignores the error and starts parsing the next account. how to do it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alan Gibizov, 2021-07-24
@phaggi

You need to properly handle the error.
In general, this is done using the try except finally construct.
For example:

try:
    result = 1 / 0
except ZeroDivisionError as error:
    print(f'Ошибка "{error}" - на ноль делить нельзя!')

P
PRoGRamm_InG, 2021-07-24
@PRoGRamm_InG

try:
    # код в котором появляется ошибка
except ошибка_которую_выдает:
    pass

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question