johnmcloud Posted January 22, 2012 Posted January 22, 2012 (edited) Hi guys, I'm searching into the forum and find some old example, but no one working fo me, so i'll decide to make a new thread. I want using it to automatic traslate a GUI The problem is the response of the page, i have try to: 1) Save the output like ini/txt 2) Save the output like mht I can't find the traslated text For now i have make: $test = @WorkingDir & "\test.mht" $word = "Bonjour" _INetGetMHT( ["http://translate.google.com/#auto|en|"] & $word, $test ) Func _INetGetMHT( $url, $file ) Local $msg = ObjCreate("CDO.Message") If @error Then Return False Local $ado = ObjCreate("ADODB.Stream") If @error Then Return False With $ado .Type = 2 .Charset = "US-ASCII" .Open EndWith $msg.CreateMHTMLBody($url, 0) $msg.DataSource.SaveToObject($ado, "_Stream") FileDelete($file) $ado.SaveToFile($file, 1) $msg = "" $ado = "" Return True EndFunc How to read the box with tralsated text? Thanks for support EDIT: Sorry for the [ ] in _INetGetMHT, i can't remove it, or the forum process it like URL Edited January 22, 2012 by johnmcloud
Mikeman27294 Posted January 22, 2012 Posted January 22, 2012 (edited) Google Translate shouldn't send a response if you are trying to translate english to english. I expect you aren't trying to translate "a word" to english? Edited January 22, 2012 by Mikeman27294
johnmcloud Posted January 22, 2012 Author Posted January 22, 2012 I have test also to different languages, but no trace into the output. $file is the directory for output.
johnmcloud Posted January 22, 2012 Author Posted January 22, 2012 (edited) Ok guys, i'll find a workaround and i'll post later I need to know how to read a file a .ini ( i know how ) but only the text in this space: class="t0">I need only this text</div> There is only one problem, can't go to next line, the text can be only on one line EDIT: Solved with an array. If need i'll post all the script in example section. Thanks Edited January 22, 2012 by johnmcloud
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now