But the code wants to run all at once, in a millisecond. By the time IE actually loads the page of search results, the entire subroutine is long over. We have to slow things down and wait for the browser while its navigating. We could use something like Application.Wait(Now + TimeValue("00:00:05")) to wait 5 seconds, but if the page loads faster we’re wasting time waiting for nothing, and if the page takes longer we’re in the same pickle as before. Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop is an elegant Do...Loop solution consisting of 3 VBA statements we’ve tidied up on one line, using colons (:) to connect them. It’s saying: while IE is busy navigating, just sit here and run in circles. objIE.Busy = True and objIE.readyState <> 4 (<> means not equal) are essentially the same thing –one could probably be ommitted– but just to make sure the page is really done loading we make both of these conditions requirements for getting out of the loop, by using the logical operator Or. The DoEvents part is technically not needed but we add it in the loop to free up processing resources and allow other things to happen within Excel during this time, asynchronous to the running loop. For the over-achievers out there, here are some other ways we could have written this line of code to do the same thing.
Docker est une solution open-source (sous licence Apache 2.0) qui vise à automatiser le déploiement d’applications dans ce que l’on nomme des “containers”. Situé à mi-chemin entre la virtualisation applicative et l’automatisation (on parle aussi de virtualisation légère), le projet a été lancé officiellement en 2013 et il ne cesse depuis de gagner en popularité.
Une fois ces étapes réalisées, vous disposerez de la configuration de base afin de pouvoir commencer à travailler sur vos scripts. Voici ci-dessous où PhantomJS doit être localisé si vous travaillez sous Windows, ce screenshot vous montre également à quoi doit ressembler votre environnement de travail. On voit le dossier "selenium" installé donc tout est prêt.