if (phantom.state.length === 0) { phantom.state = 'setup'; phantom.open('http://touch.facebook.com/r.php'); } else { if (document.URL == 'http://touch.facebook.com/r.php') { var body = document.body; body.querySelector('input[name='firstname']').value = ' '; body.querySelector('input[name='lastname']').value = ' '; body.querySelector('input[name='email']').value = ''; body.querySelector('input[name='gender']').value = '2'; body.querySelector('input[name='pass']').value = ' '; body.querySelector('что здесь????').click(); } else if (document.URL == '') { console.log('success'); phantom.exit(0); } }