We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 08730a1 + 19c74c6 commit 839bba8Copy full SHA for 839bba8
1 file changed
crawling/koreatech_article/convert_content.py
@@ -23,8 +23,8 @@ def convert_content_to_url(connection):
23
last_id = 0
24
total_articles = 0
25
26
- while True:
27
- try:
+ try:
+ while True:
28
cur.execute("""
29
SELECT `id`, `board_id`, `content`
30
FROM `new_articles`
@@ -60,12 +60,12 @@ def convert_content_to_url(connection):
60
61
connection.commit()
62
63
- except Exception as error:
64
- connection.rollback()
65
- print(error)
66
- finally:
67
- cur.close()
68
- print(f"total articles: {total_articles}")
+ except Exception as error:
+ connection.rollback()
+ print(error)
+ finally:
+ cur.close()
+ print(f"total articles: {total_articles}")
69
70
71
if __name__ == "__main__":
0 commit comments