Last active
August 29, 2015 14:01
-
-
Save kazufusa/3a95ebdd22cb0e66a09d to your computer and use it in GitHub Desktop.
web_crawler_with_CasperJS
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
window.urls = {} | |
search_urls = (url) -> | |
casper.thenOpen url, -> | |
window.urls[url] = [] | |
children = @evaluate -> | |
search_innner_href() | |
window.urls[url] = children | |
casper.then -> | |
i = 0 | |
casper.each window.urls[url], -> | |
search_urls window.urls[url][i] | |
i += 1 | |
#casper.eachThen window.urls[url], (response) -> | |
# search_urls(response.data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment