Last active
August 25, 2016 01:22
-
-
Save Everlag/a091036678685089898090f32102ec24 to your computer and use it in GitHub Desktop.
Hacker News scraper badness repoduction
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
commentContainers = document.querySelectorAll('td.default') | |
firstCommentContainer = comments[0] | |
// Fetch depth=upvote.width/40 | |
function getHtml(commentContainer) { | |
// Doesn't work: | |
nothing = commentContainer.querySelectorAll('span.comment') | |
something = commentContainer.querySelectorAll('div.comment') | |
console.log(nothing, 'vs', something) | |
} | |
console.log(getHtml(firstCommentContainer)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment