Skip to content

Commit 75f0cd3

Browse files
Merge pull request #2469 from avinashkranjan/deepsource-transform-aee4afeb
format code with autopep8
2 parents 549b2e9 + 0389721 commit 75f0cd3

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

GeeksforGeeks-Scrapper/gfg.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from selenium.webdriver.chrome.service import Service
66
from selenium.webdriver.support.ui import WebDriverWait
77

8+
89
class geeksforgeeks:
910
service = Service(ChromeDriverManager().install())
1011
driver = webdriver.Chrome(service=service)
@@ -78,7 +79,8 @@ def get_popular_now(self):
7879
"message": "Popular Courses are now fetched",
7980
}
8081
except (WebDriverException, NoSuchElementException) as e:
81-
raise Exception(f"An error occurred while scraping popular courses: {str(e)}")
82+
raise Exception(
83+
f"An error occurred while scraping popular courses: {str(e)}")
8284

8385
def get_self_paced(self):
8486
"""
@@ -111,7 +113,8 @@ def get_self_paced(self):
111113
},
112114
)
113115
name.append(course_name.text)
114-
course_rating = items.find("div", {"class": "courseListingPage_courseCardContentsGrid__jk3VM"}).find("span",{"class":"urw-din"})
116+
course_rating = items.find("div", {"class": "courseListingPage_courseCardContentsGrid__jk3VM"}).find(
117+
"span", {"class": "urw-din"})
115118
if not course_rating:
116119
course_rating = "Information not available"
117120
else:
@@ -142,7 +145,8 @@ def get_self_paced(self):
142145
"message": "Self paced Courses are now fetched",
143146
}
144147
except (WebDriverException, NoSuchElementException) as e:
145-
raise Exception(f"An error occurred while scraping popular courses: {str(e)}")
148+
raise Exception(
149+
f"An error occurred while scraping popular courses: {str(e)}")
146150

147151
def get_live_course(self):
148152
"""
@@ -207,5 +211,5 @@ def get_live_course(self):
207211
"message": "Live Courses are now fetched",
208212
}
209213
except (WebDriverException, NoSuchElementException) as e:
210-
raise Exception(f"An error occurred while scraping popular courses: {str(e)}")
211-
214+
raise Exception(
215+
f"An error occurred while scraping popular courses: {str(e)}")

0 commit comments

Comments
 (0)