Sign in to follow this  
Followers 0
mhk

how to copy and past from browser

20 posts in this topic

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

Share this post


Link to post
Share on other sites



i used but not work

local $t1 = _IEGetObjById($oIE,"t-1")
local $tr1 = _IEGetObjById ($oIE,"text-1")
 
_IEFormElementSetValue($tr1,$t1.innertext)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

console what mean?

it's site like yahoo

i want to copy text in 1th position to 2th position

is my code ok?

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 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.

Share this post


Link to post
Share on other sites

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".:

Share this post


Link to post
Share on other sites

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 Gude
How 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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

#11 ·  Posted (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 by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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.

 

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

#13 ·  Posted (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 by jdelaney
1 person likes this

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.

Share this post


Link to post
Share on other sites

thanks for your help

can you write sample code for it?

Share this post


Link to post
Share on other sites

#16 ·  Posted (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 by mhk

Share this post


Link to post
Share on other sites

how can i simulate ctrl+c and ctrl+V in browser?

Share this post


Link to post
Share on other sites

#18 ·  Posted (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 by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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.

 

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

One other way, without having to worry about the inconsitency of send()

_IEFormElementSetValue($oObj,ClipGet())
Edited 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.

Share this post


Link to post
Share on other sites

thanks alot every one

i solve problem with:

first focus

second action click

third send enter

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