I have over 150 links that were returned as broken links via the link validator. I'd like to export the listing into a spreadsheet so that I can track what was fixed.
Is there an option in exporting the list rather than me copying/paste in a spreadsheet or document?
@MarandaMiller
What I normally do is work my way through the list and then re-run the validator after I have fixed a bunch of stuff. Since you can click on the title, I normally go through and ctrl-click several of those to open in a new tab and then I close the tab once I've made the changes. Most people will find it easier to work this way than to work from a spreadsheet, especially since those 150 broken links could be across just 10 pages and you'll fix all the items on one page at a time. It goes faster than you might think when seeing the initial 150 warnings.
That said, if you really want a list in a spreadsheet, you can scrape the web page and extract the links.
I quickly threw something together that would generate a tab-separated list of all of the information from the link validator. You can then copy/paste it into a spreadsheet. It wouldn't take much to make a userscript out of this that actually creates a spreadsheet, but I don't have the time to fully debug or support it right now and I haven't seen a lot of demand for something like this.
The script gives you columns for the item (page, assignment, etc.) title, the link to the Canvas item, the type of item, the message, the link that is problematic, and the text of the link. It handles the cases where items have multiple types of messages (thanks go to one of my unnamed colleagues for having a page with 25 broken links).
These directions are for Chrome, but the script should work in all major browsers.
var info = [['title','url','type','message','link','linkUrl']]; document.querySelectorAll('#all-results div.result').forEach(r => { const headEl = r.querySelector('h2'); const headLink = headEl.querySelector('a'); const typeEl = headEl.parentNode.querySelector('span'); const messagesEl = r.querySelector('ul'); const title = headLink.textContent; const titleUrl = headLink.href; const type = typeEl.textContent; for (const m of messagesEl.children) { if (!m.nodeName === 'LI') { continue; } const messageFullText = m.textContent; const itemsEl = m.querySelector('ul'); const partialText = itemsEl.textContent; const messageText = messageFullText.slice(0,messageFullText.length-partialText.length); itemsEl.querySelectorAll('li a').forEach(e => { console.log(e); const link = e.href; const linkText = e.textContent; const item = [title, titleUrl, type, messageText, link, linkText]; info.push(item); }); } }); console.log(info.map(e => e.join('\t')).join('\n'));
Hey @MarandaMiller!
That is a great question! I am not aware of a way to export the results and there is nothing mentioned in the Community Guide How do I validate links in a course? that states anything about exporting the results. If anyone has some other thoughts regarding this, hopefully they will chime in.
Thank you all for this information and the code to scrape the web results.
I found an easier way that doesn't require any scripting. There is a link validation API endpoint, but it's not documented so I didn't know about it.
I think my script returns the results in a nicer format than either one of them, but you can get the results without coding or using the developer tools.
Enhance your access to articles, forums, and events—and to participate by sharing insights, engaging in discussions, and connecting with your network of edtech peers.
Hi everyone, We use Canvas to share study material (videos, PDFs, reading material) and quizzes with doctors enrolled in our courses. Our usual workflow is to add the doctor to the course, wait for them to accept the invitation, and then assign them the required quizzes. I’m having a problem with one student. I added her…
Searching through 'All Pages' can be cumbersome, especially as the year goes on. Is there going to be a folders feature added so that pages can be sorted and categorized, similar to how documents and images can fall under different umbrellas?
For those of you who use the Learning Mastery Gradebook in your courses, what are your thoughts about the updates? Do they improve your understanding of students' outcome mastery? What about the interface? The old version certainly needed some improvements. I did like the pie charts, however. Hovering the mouse pointer…
Error message when viewing SCORM files as Admin login: This XML file does not appear to have any style information associated with it. The document tree is shown below. <Error> <Code>MissingKey</Code> <Message> Missing Key-Pair-Id query parameter or cookie value </Message> </Error> When viewing as a student login the SCORM…
I have now had a few cases of students' responses in New Quizzes not being recorded. Normally, students get a connection error and can restart, but here they get new questions one at a time with no indication of a problem until they try to submit the exam and find that they can't submit it. Students are losing 20-90% of…