File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1109,6 +1109,11 @@ def get_course_id(self):
1109
1109
except requests .exceptions .ConnectionError :
1110
1110
r = None
1111
1111
continue
1112
+ except Exception as e :
1113
+ logger .error (f"Error fetching course ID: { e } " )
1114
+ logger .error (f"Course URL: { url } " )
1115
+ r = None
1116
+ continue
1112
1117
1113
1118
if r is None :
1114
1119
logger .error ("Failed to fetch course ID after 3 attempts" )
@@ -1122,7 +1127,6 @@ def get_course_id(self):
1122
1127
course_id = soup .find ("body" ).get ("data-clp-course-id" , "invalid" )
1123
1128
if course_id == "invalid" :
1124
1129
self .course .is_valid = False
1125
- logger .error (soup .prettify (encoding = "utf-8" ))
1126
1130
self .course .error = "Course ID not found: Report to developer"
1127
1131
return
1128
1132
Original file line number Diff line number Diff line change @@ -185,6 +185,8 @@ def create_scraping_thread(site: str):
185
185
time .sleep (0.1 )
186
186
187
187
udemy .progress .update (task_id , completed = getattr (scraper , f"{ code_name } _length" ))
188
+ logger .debug (f"Courses Found { code_name } : { len (getattr (scraper , f'{ code_name } _data' ))} " )
189
+
188
190
if getattr (scraper , f"{ code_name } _error" ):
189
191
raise Exception (f"Error in: { site } " )
190
192
except Exception :
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ def create_scraping_thread(site: str):
66
66
)
67
67
68
68
time .sleep (0.1 )
69
-
69
+ logger . info ( f"Courses Found { code_name } : { len ( getattr ( scraper , f' { code_name } _data' )) } " )
70
70
if getattr (scraper , f"{ code_name } _error" ):
71
71
raise Exception (f"Error in: { site } " )
72
72
except Exception :
You can’t perform that action at this time.
0 commit comments