Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Returns a list of source urls of all images used on a single wikipedia article. Use this in the console.
(await Promise.all(
[...document.querySelectorAll('#bodyContent a.image')]
.map(node => (async (url) => (new DOMParser().parseFromString(
await window.fetch(url).then(response => response.text()),
'text/html'
).querySelector('.fullMedia a.internal') || { }).href)(node.href))
)).join('\n');
@thany

This comment has been minimized.

Copy link
Owner Author

thany commented Jan 14, 2020

Please refrain from using this for insincere purposes. Please respect fair use & copyrights.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.