phantomjs - How to export/extract google satelite map to the images automatically? -


I need to use some Google Arial photos for image processing, and because I need many pictures, so It is difficult to manually manually screen these pictures with a hand shot in hand, so I am thinking that there is a way to automatically export satellite images given at the geographical location.

I am using nodes.js, and it's zombie and potty JS is an approach to emulate a human browser, it is possible to retrieve HTML from the browser, but Google Map can be used to present HTML and then allow me to screenshots

Yes, this is done very easily with plain fontgays. You can also use zombiejs or casper js for this. They make it easy to handle without any steps in callback hell or static code.

I have added the necessary functions to click and type, the installation of the user agent string is necessary because otherwise Google will deliver code that may not be on the old (old) PhantomJS 1.x engine Could.

  Var page = requirement ('webpage'). Create (), classical = true; // This user works well with advanced GM pages. Settings.userAgent = 'Mozilla / 5.0 (Windows NT 6.0) Apple WebKat / 535.1 (KHML, like GECO) Chrome / 13.0.782.41 Safari / 535.1'; Page.viewportSize = {width: 1280, height: 800}; Function click (selector) {page.evaluate (function (selector) {// taken from here: http://stackoverflow.com/a/15948355 var ev = document.createEvent ("MouseEvent"); ev.initMouseEvent ( "Click", true / * bubble * /, true / * cancelable * /, window, blank, 0, 0, 0, 0, / * coordinate * / false, false, false, false, / * modifier keys * / 0 / * left * /, tap); document.quire selector (discreet event); selector); } Function type (text) {page.evaluate (function (text, classical) {varel = document.query selector (classical? "#gbqfq": "#searchboxinput"); el.value = text; el.focus () ;}, Text, classical); Page. SendEvent ('keypress', page.event.key.Enter); } Page.open ("https://www.google.com/maps", function (status) {if (status! == 'success') {console.log ('Unable to access network'); phantom Exit (classical) {click ("# paneltoggle2"}}} setTimeout (function () {page.render ("1.png"); Click (classical? "# Mv-primary-container> .mv-primary ":" Button.widget-minimap-shim ");}, 1000); // +1 seconds set timeout (function () {page.render (" 2.png "); type (" berne ");}, 11000); // + 10 sec set timeout (function () (if classical) {click ("# pentatagal 2");}}, 16000); // + 5 seconds set timeout (function () {page.render ("3. PGN"); Fastam.Exit ( );}, 21000); // + 5 seconds}});  

If you are using the version of Fontem & lt; 1.9.8, you should call it - ssl -protocol = tlsv1 , which can also be helpful in cropping images so that the controls do not get visible.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -