mhk Posted May 12, 2014 Share Posted May 12, 2014 hi every body i want to copy text file(blue( main not color)) from <div class="buy6" id="t-1">Paying since 2008</div> and past it in <input class="buy5" type="text" id="text-1" name="text"> how??? thanks alot Link to comment Share on other sites More sharing options...
jdelaney Posted May 12, 2014 Share Posted May 12, 2014 _IEAttach _IETagNameGetCollection, or _IEGetObjById _IEPropertyGet...use the option to get innertext _IEFormElementSetValue mhk 1 IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
mhk Posted May 12, 2014 Author Share Posted May 12, 2014 i used but not work local $t1 = _IEGetObjById($oIE,"t-1") local $tr1 = _IEGetObjById ($oIE,"text-1") _IEFormElementSetValue($tr1,$t1.innertext) Link to comment Share on other sites More sharing options...
jdelaney Posted May 12, 2014 Share Posted May 12, 2014 What was the console output....all of it. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
mhk Posted May 12, 2014 Author Share Posted May 12, 2014 console what mean? it's site like yahoo i want to copy text in 1th position to 2th position is my code ok? Link to comment Share on other sites More sharing options...
jdelaney Posted May 12, 2014 Share Posted May 12, 2014 (edited) When you run the script through scite, what errors, and console output, do you get. As is, your code is not complete. You need to: #include <IE.au3> and you need to _ieattach to a browser, or _iecreate a browser. Edited May 12, 2014 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
mhk Posted May 12, 2014 Author Share Posted May 12, 2014 it's part of my code i used #include <IE.au3> for this line _IEFormElementSetValue($tr1,$t1.innertext) say ==> Variable must be of type "Object".: Link to comment Share on other sites More sharing options...
BrewManNH Posted May 12, 2014 Share Posted May 12, 2014 Post your script If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
mhk Posted May 13, 2014 Author Share Posted May 13, 2014 i solve my code problem i open new tab and i must set new tab name to my code but i used first tab name correct code: local $t1 = _IEGetObjById($oIE1,"t-1") local $tr1 = _IEGetObjById ($oIE1,"text-1") _IEFormElementSetValue($tr1,$t1.innertext) Link to comment Share on other sites More sharing options...
mhk Posted May 13, 2014 Author Share Posted May 13, 2014 now i have another problem i want to click enter after write text in that place when i used Send("{ENTER}") it replace text with "1" how to send? Link to comment Share on other sites More sharing options...
bogQ Posted May 13, 2014 Share Posted May 13, 2014 (edited) After you have your IE Object: To interact with some element object you first get that element object, for example _IEGetObjByName, _IEGetObjById Other posabilities are _IEForm* commands and then interact with that element object for example _IEAction($oSubmit, "click") or with form if you need to submit form for example _IEFormSubmit or interacting and accessing commands with them like you already did from objests $t1.innertext() where your best guide shud be javascript commands in that case. So instead something like _IEAction($oSubmit, "click") in other way you can use $oSubmit.click() For more specific info post what object you need to interact with (small page source containing object or link to the page itself), what have you already tried that did not work (your script that did not work), and tell us what exactly you need to do to that object. Edited May 13, 2014 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
mhk Posted May 13, 2014 Author Share Posted May 13, 2014 nothing happen but manually after write text with script when i click on text and then click ctrl or enter or shift site accepted my text and allow me to go another level What should I do? Link to comment Share on other sites More sharing options...
jdelaney Posted May 13, 2014 Share Posted May 13, 2014 (edited) It's probably an OnKeyPress event...or KeyDown, or something. You can use ControlSend, after focusing on the element. Or, if it's a button that needs to be enabled, you can always force it to be, by removing the style. Edited May 13, 2014 by jdelaney mhk 1 IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
mhk Posted May 13, 2014 Author Share Posted May 13, 2014 thanks for your help can you write sample code for it? Link to comment Share on other sites More sharing options...
jdelaney Posted May 13, 2014 Share Posted May 13, 2014 mhk 1 IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
mhk Posted May 14, 2014 Author Share Posted May 14, 2014 (edited) i used this code but like before script only write text and not click any key like ctrl or shift or .... $hWin = _IEPropertyGet($oIE1,"hwnd") WinActivate($hWin) $hControl = ControlGetHandle($hWin,"","[CLASS:Internet Explorer_Server; INSTANCE:1]") $te1.focus $te1.value = $t1.innertext ControlSend($hWin, "", $hControl, "test") $te1.value = $t1.innertext Edited May 14, 2014 by mhk Link to comment Share on other sites More sharing options...
mhk Posted May 16, 2014 Author Share Posted May 16, 2014 how can i simulate ctrl+c and ctrl+V in browser? Link to comment Share on other sites More sharing options...
bogQ Posted May 16, 2014 Share Posted May 16, 2014 (edited) you can try>#5 but i dont think it will work coz we still dont know what wer working with.note that _IEAction can use 'paste' as $s_action For key sending you can try to look at Send() in a help file (if you readeed that func reference then you will know how to send ctrl+c and similar), ControlSend() works similar to Send() for exception characters so it whud be a good thing before you use it to read about both commands in a help file.As i already told you, we can guess 30 times and still no one would know how to help you correctly, till you post data to what your trying to interact with your just wasting your time. So post Url to page your trying to automate or page source. Then maybe someone will come along who know how to help you correctly. Edited May 16, 2014 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
jdelaney Posted May 16, 2014 Share Posted May 16, 2014 (edited) One other way, without having to worry about the inconsitency of send() _IEFormElementSetValue($oObj,ClipGet()) Edited May 16, 2014 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Solution mhk Posted May 18, 2014 Author Solution Share Posted May 18, 2014 thanks alot every one i solve problem with: first focus second action click third send enter Link to comment Share on other sites More sharing options...
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