Created
June 16, 2017 00:41
-
-
Save nazimamin/600c983764260f260141fc56c1e2d229 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//get quotes fro https://worldhistoryproject.org/topics/mahatma-gandhi | |
var items = document.getElementsByClassName("media-list")[0].children; | |
for (var item in items) { | |
var time = item.children[0].textContent; | |
var mediaHeading = item.children[1].children[1].children[0].innerText; | |
var link = item.children[1].children[1].children[0].getAttribute("href"); | |
const output = `<li> | |
<a href="https://worldhistoryproject.org${link}"> | |
<b>${time.trim()}</b> - ${mediaHeading}. | |
</a> | |
</li>`; | |
console.log(output); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment