FULL CODE & MORE LIKE THIS: http://blog.breakthru.solutions/auto-...
Vo.js: https://github.com/matthewmueller/vo
Javascript is asynchronous meaning that different task can execute at the same time. Normally this a good thing but when you are trying to get a web bot to do things in a specific order its pretty awful. The typical way of dealing with would be to use call backs. But if you do that….it crashes.
So it turns out that nightmare actually uses promises to perform all its actions in a “synchronous” manner. So when you run a nightmare instance and assign those to a function what happens is that it “promises” to do everything youve told it to do. However, when you run it in a loop - nightmare promises to do the work, then the loop accepts the promise as valid AND moves on to the next task on its list. If that task is another nightmare instance then the two nightmare instances try to use the same browser at the same time. Both nightmare instances give up on life and crash your program.
Theres a couple way we can deal with this. However, the one I like best is generators. Generators are a new feature in javascript. You can think of a generator as a “pauseable” function. This makes your javascript behave the way you would expect code to execute in almost every other programming language.
Смотрите видео Web Bot Tutorial - Auto Post to Craigslist - 4/4 - Modules and Asynchronous Code with Nightmare.js онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Powerslacker 03 Ноябрь 2016, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 1,901 раз и оно понравилось 37 людям.