Skip to content

find ressources tab bug fixed #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions clone-moodle.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,12 @@ def findRessourceTab(html):
tabs = html.find("ul",attrs={"class":"unlist"}).find_all("li")

for tab in tabs:
if('resources' in tab.a.get('href')):
linkTab = tab.a.get('href')
else :
break
else:
linkTab = "none"
return linkTab


def savefile(title,documentlink,cookie):
reqDocument = request(documentlink,cookie)
filetype = reqDocument.headers['content-type'].split('/')[-1]
Expand Down Expand Up @@ -188,7 +187,7 @@ def main():

# Creating the class folder
createFolder(title)

# Trying to access the ressource tab
ressourceLink = findRessourceTab(thisClassHTML)

Expand All @@ -200,7 +199,7 @@ def main():
os.chdir("..")
continue
ressourceHTML = BeautifulSoup(req.text,"html.parser")

findAllDocuments(ressourceHTML,loginCookie)
os.chdir("..")
os.chdir("..")
Expand Down