Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CasperJSで診断メーカーする
#! /usr/bin/env casperjs
# ./shindan_casper.coffee '趣味はマリンスポーツです'
casper = do (require 'casper').create
casper.start 'http://shindanmaker.com/c/list?mode=hot', ->
href = @evaluate ->
links = (document.querySelectorAll '.list_title')
links[Math.floor (do Math.random * links.length)].href
casper.open href
casper.then ->
@echo @getTitle()
casper.fill '#form',
u: casper.cli.args[0]
@click '#form input[type="submit"]'
casper.then ->
result = @evaluate ->
document.querySelector('#forcopy textarea').value
@echo result
do casper.run
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.