mirror of
https://github.com/KevinMidboe/ITLscraper.git
synced 2025-10-29 17:50:14 +00:00
add option
This commit is contained in:
@@ -223,8 +223,7 @@ class itslearning_scraper():
|
|||||||
Process(target=self.find_files, args=(table,)).start()
|
Process(target=self.find_files, args=(table,)).start()
|
||||||
os.chdir('..')
|
os.chdir('..')
|
||||||
|
|
||||||
def download_one(self):
|
def download_one(self, url):
|
||||||
course_url = input("Emne link:")
|
|
||||||
folder_title=input("folder title:")
|
folder_title=input("folder title:")
|
||||||
r = rq.get(course_url, cookies=self.cookies)
|
r = rq.get(course_url, cookies=self.cookies)
|
||||||
course_path = os.path.join(os.path.abspath(os.path.curdir))
|
course_path = os.path.join(os.path.abspath(os.path.curdir))
|
||||||
@@ -243,4 +242,8 @@ class itslearning_scraper():
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
scraper = itslearning_scraper()
|
scraper = itslearning_scraper()
|
||||||
scraper.enter()
|
scraper.enter()
|
||||||
scraper.download_all()
|
url = input("Enter course url or press enter to download all active courses:")
|
||||||
|
if url:
|
||||||
|
scraper.download_one(url)
|
||||||
|
else:
|
||||||
|
scraper.download_all()
|
||||||
|
|||||||
Reference in New Issue
Block a user