Sign in to follow this  
Followers 0
gil900

Upload a photo to google search by image

11 posts in this topic

I need to upload an image to google search by image and then get the variable the page after a search .. This is possible in AutoIt3?

If so then how?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

This has nothing to do with AutoIT.

The images in Google search are scraped by Google's own spiders and they determine what shows up when a user does a search. In other words, you don't upload a picture to Google search nor can force it to show. Its under their criteria.

To be given the *possibility* of Google including your picture into their search results, you must own a website and have pages with the images in it. However, that does not guarantee that your images will show up in Google search.

Edited by StringingLong

Share this post


Link to post
Share on other sites

I need to upload an image to google search by image and then get the variable the page after a search .. This is possible in AutoIt3?

If so then how?

Hi,

You mean dropping an image and then make a search for it?

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hi,

You mean dropping an image and then make a search for it?

Br, FireFox.

yes..

and then get the results page.

like what he did here:

but i need it for Google

Edited by gil900

Share this post


Link to post
Share on other sites

@gil900

OK, I have not the time right now, so I will keep you in touch.

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

@gil900

OK, I have not the time right now, so I will keep you in touch.

Br, FireFox.

This is also a welcome response.

I tried without a break and at the end I realized that's the problem:

Variable must be of type "Object"

stop me..

I found this topic:

# entry804215

And then I realized something was wrong ..

I am also very grateful to this response .. At least I know now that someone will help me.

Share this post


Link to post
Share on other sites

@gil900

I'm not going to use the _IE UDF as long as in my opinion the browser sucks and It's not a furtive way to do it, which also sucks.

I will use the WinHTTP UDF or the curl exe, or in "pure" autoit.

Br, FireFox.

1 person likes this

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

This is what I have :

#include "WinHttp.au3"
;~ #include <INet.au3>

Global $hOpen = _WinHttpOpen()
Global $sAddress = "http://www.google.fr/searchbyimage/upload"

;~ ConsoleWrite(_INetGetSource("http://www.google.fr/imghp?sbi=1") & @CRLF)

Local $sLocalForm = _
        '<form method="POST" enctype="multipart/form-data" action="' & $sAddress & '">' & _
            '<input name="image_url">' & _
            '<input type="file" name="encoded_image">' & _
            '<input type="hidden" name="image_content">' & _
            '<input type="hidden" name="filename">' & _
            '<input type="hidden" name="num">' & _
            '<input type="hidden" name="hl">' & _
            '<input type="hidden" name="bih">' & _
            '<input type="hidden" name="biw">' & _
        '</form>'

Local $sRead = _WinHttpSimpleFormFill($sLocalForm, $hOpen, Default, _
        "encoded_image", @ScriptDir & "myimg.jpg", _
        "num", 10, _
        "h1", "fr", _
        "bih", 573, _
        "biw", 1193)
_WinHttpCloseHandle($hOpen)

ConsoleWrite($sRead & @CRLF)

But I'm not able to make it work... the page is totally made in javascript and I can't retreive the form data because I think that the datas "bih" and "biw" must be right to succeed.

Edit : typo.

Br, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

This is what I have :

#include "WinHttp.au3"
;~ #include <INet.au3>

Global $hOpen = _WinHttpOpen()
Global $sAddress = "http://www.google.fr/searchbyimage/upload"

;~ ConsoleWrite(_INetGetSource("http://www.google.fr/imghp?sbi=1") & @CRLF)

Local $sLocalForm = _
'<form method="POST" enctype="multipart/form-data" action="' & $sAddress & '">' & _
'<input name="image_url">' & _
'<input type="file" name="encoded_image">' & _
'<input type="hidden" name="image_content">' & _
'<input type="hidden" name="filename">' & _
'<input type="hidden" name="num">' & _
'<input type="hidden" name="hl">' & _
'<input type="hidden" name="bih">' & _
'<input type="hidden" name="biw">' & _
'</form>'

Local $sRead = _WinHttpSimpleFormFill($sLocalForm, $hOpen, Default, _
"encoded_image", @ScriptDir & "myimg.jpg", _
"num", 10, _
"h1", "fr", _
"bih", 573, _
"biw", 1193)
_WinHttpCloseHandle($hOpen)

ConsoleWrite($sRead & @CRLF)

But I'm not able to make it work... the page is totally made in javascript and I can't retreive the form data because I think that the datas "bih" and "biw" must be right to succeed.

Edit : typo.

Br, FireFox.

This is what I have :

#include "WinHttp.au3"
;~ #include <INet.au3>

Global $hOpen = _WinHttpOpen()
Global $sAddress = "http://www.google.fr/searchbyimage/upload"

;~ ConsoleWrite(_INetGetSource("http://www.google.fr/imghp?sbi=1") & @CRLF)

Local $sLocalForm = _
'<form method="POST" enctype="multipart/form-data" action="' & $sAddress & '">' & _
'<input name="image_url">' & _
'<input type="file" name="encoded_image">' & _
'<input type="hidden" name="image_content">' & _
'<input type="hidden" name="filename">' & _
'<input type="hidden" name="num">' & _
'<input type="hidden" name="hl">' & _
'<input type="hidden" name="bih">' & _
'<input type="hidden" name="biw">' & _
'</form>'

Local $sRead = _WinHttpSimpleFormFill($sLocalForm, $hOpen, Default, _
"encoded_image", @ScriptDir & "myimg.jpg", _
"num", 10, _
"h1", "fr", _
"bih", 573, _
"biw", 1193)
_WinHttpCloseHandle($hOpen)

ConsoleWrite($sRead & @CRLF)

But I'm not able to make it work... the page is totally made in javascript and I can't retreive the form data because I think that the datas "bih" and "biw" must be right to succeed.

Edit : typo.

Br, FireFox.

Link www.google.com/searchbyimage/upload

also good ..

Have you heard about the plugin "http headers" to the browser - Firefox?

This plugin shows the command you send to the site.

For example, when I sent that message in this post i send some command.

So that base idea. If you can send a request this way so you do not depend on the javacript ..

If this is not what you did, then maybe to try it.

I'm just giving an idea.

Edited by gil900

Share this post


Link to post
Share on other sites

I reveal the Google sending command:

-----------------------------41184676334rn
Content-Disposition: form-data; name="image_url"rn
rn
rn
-----------------------------41184676334rn
Content-Disposition: form-data; name="encoded_image"; filename="1.png"rn
Content-Type: image/pngrn
rn
x89PNGrn
x1an
This command is to:

http://www.google.com/searchbyimage/upload

image:

Posted Image

i hope it is help...

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

I also have a code of iMacros for Firefox.

This is the code:

TAB T=1
URL GOTO=http://www.google.com/imghp?hl=en&tab=wi
WAIT SECONDS=2
TAG POS=1 TYPE=SPAN ATTR=ID:qbi
TAG POS=1 TYPE=A ATTR=TXT:Upload<SP>an<SP>image
TAG POS=1 TYPE=INPUT:FILE FORM=ACTION:/searchbyimage ATTR=ID:qbfile CONTENT=D:1.jpg

Maybe possible to convert the code to AutoIt3 language.

Please help me ...

Edited by gil900

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0