title: Script to use Google Image Search with local image as input
body: <p>I'm looking for a batch or Powershell script to search for similar images on Google images using a local image as input.</p>
  
  <p><img src="https://i.stack.imgur.com/KRDYr.png" alt="enter image description here"></p>
  
  <p><strong>My research so far</strong></p>
  
  <p>The syntax for a image search using a URL rather than a local file is as followes:<br>
  <code><a href="https://www.google.com/searchbyimage?image_url=TEST" rel="noreferrer">https://www.google.com/searchbyimage?image_url=TEST</a></code><br>
  where TEST can be replaced with any image URL you have.</p>
  
  <p>I played with <a href="http://curl.haxx.se/download.html" rel="noreferrer">cURL for windows</a> and <a href="http://api.imgur.com/" rel="noreferrer">imgur</a> as temporary image saver. 
  I was able to upload a file to imgur via batch. The image URL was then used to search similar images on Google.</p>
  
  <p>But I wonder if it is possible without using any temporary cache like imgur or any other online picture service. Just a batch, curl, Google and me.</p>
  
  <p>Just a thought. Is a VBS script maybe capable to search on Google Images with a local file as input?<br>
  Or are similar web services like <a href="http://www.tineye.com/" rel="noreferrer">Tineye</a> better suited for that task?</p>
  
  <hr>
  
  <p>This powershell snippet will open Googles Image Search.  </p>
  
  <pre><code>$IE= new-object -com InternetExplorer.Application
  $IE.navigate2("https://www.google.com/imghp?hl=en")
  while ($IE.busy) {
  sleep -milliseconds 50
  }
  $IE.visible=$true
  </code></pre>
  
  <p>The next steps would be to get the IDs of some buttons and click them programmatically to select the local file. But here I'm not experienced enough to achieve this. </p>