When I am trying to download the courses, I am getting a connection reset message .
for e in chosen_courses:
course_title = courses_t[int(e)-1]
print(e + ' '+course_title)
lecture_homepage = homepage + courses_u[int(e)-1]
os.chdir(initial_dirname)
create_download_dir(courses_t[ int(e)- 1])
a,b,c = enumerate_lessons(lecture_homepage)
lessons = zip(a,b,c)
download_videos(lessons)
#create_m3u_playlist(course_title)
download_quiz(lessons)
download_html(lessons)
os.chdir(initial_dirname)
print('download finished')
Executing the above cell gives me this stacktrace and a strange ConnectionReset error.
Is it implemented by Coursera?
2 Machine Learning: Regression
/Users/gparasha/Downloads/www-coursera-downloader-master/Machine Learning Regression/Machine Learning Regression
---------------------------------------------------------------------------
ConnectionResetError Traceback (most recent call last)
<ipython-input-85-ce301f5ab8ea> in <module>()
7 create_download_dir(courses_t[ int(e)- 1])
8
----> 9 a,b,c = enumerate_lessons(lecture_homepage)
10 lessons = zip(a,b,c)
11
<ipython-input-73-90d09d2102ab> in enumerate_lessons(lecture_homepage)
1 def enumerate_lessons(lecture_homepage):
2
----> 3 weeks = enumerate_weeks(lecture_homepage)
4 w_digit = len(str(len(weeks)))
5
<ipython-input-72-94389983aa33> in enumerate_weeks(lecture_homepage)
5 weeks = []
6
----> 7 if browser.find_by_text('Preview Week 1'):
8
9 week = lecture_homepage.replace('welcome','week/')
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/splinter/driver/webdriver/__init__.py in find_by_text(self, text)
406 def find_by_text(self, text):
407 return self.find_by_xpath('//*[text()="%s"]' % text,
--> 408 original_find='text', original_query=text)
409
410 def find_by_id(self, id):
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/splinter/driver/webdriver/__init__.py in find_by_xpath(self, xpath, original_find, original_query)
393 return self.find_by(
394 self.driver.find_elements_by_xpath, xpath, original_find=original_find,
--> 395 original_query=original_query)
396
397 def find_by_name(self, name):
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/splinter/driver/webdriver/__init__.py in find_by(self, finder, selector, original_find, original_query)
371 while time.time() < end_time:
372 try:
--> 373 elements = finder(selector)
374 if not isinstance(elements, list):
375 elements = [elements]
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py in find_elements_by_xpath(self, xpath)
407 elements = driver.find_elements_by_xpath("//div[contains(@class, 'foo')]")
408 """
--> 409 return self.find_elements(by=By.XPATH, value=xpath)
410
411 def find_element_by_link_text(self, link_text):
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py in find_elements(self, by, value)
993 return self.execute(Command.FIND_ELEMENTS, {
994 'using': by,
--> 995 'value': value})['value'] or []
996
997 @property
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py in execute(self, driver_command, params)
316
317 params = self._wrap_value(params)
--> 318 response = self.command_executor.execute(driver_command, params)
319 if response:
320 self.error_handler.check_response(response)
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/remote_connection.py in execute(self, command, params)
470 data = utils.dump_json(params)
471 url = '%s%s' % (self._url, path)
--> 472 return self._request(command_info[0], url, body=data)
473
474 def _request(self, method, url, body=None):
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/remote_connection.py in _request(self, method, url, body)
494 try:
495 self._conn.request(method, parsed_url.path, body, headers)
--> 496 resp = self._conn.getresponse()
497 except (httplib.HTTPException, socket.error):
498 self._conn.close()
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py in getresponse(self)
1329 try:
1330 try:
-> 1331 response.begin()
1332 except ConnectionError:
1333 self.close()
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py in begin(self)
295 # read until we get a non-100 response
296 while True:
--> 297 version, status, reason = self._read_status()
298 if status != CONTINUE:
299 break
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py in _read_status(self)
256
257 def _read_status(self):
--> 258 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
259 if len(line) > _MAXLINE:
260 raise LineTooLong("status line")
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py in readinto(self, b)
584 while True:
585 try:
--> 586 return self._sock.recv_into(b)
587 except timeout:
588 self._timeout_occurred = True
ConnectionResetError: [Errno 54] Connection reset by peer