Skip to content

Instantly share code, notes, and snippets.

@kazufusa
Last active August 29, 2015 14:01
Show Gist options
  • Save kazufusa/3a95ebdd22cb0e66a09d to your computer and use it in GitHub Desktop.
Save kazufusa/3a95ebdd22cb0e66a09d to your computer and use it in GitHub Desktop.
web_crawler_with_CasperJS
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