Jump to content

how to copy and past from browser


Go to solution Solved by mhk,

Recommended Posts

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

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.
Link to comment
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

Link to comment
Share on other sites

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

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.

 
Link to comment
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?

Link to comment
Share on other sites

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

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
Link to comment
Share on other sites

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.

 
Link to comment
Share on other sites

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.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...