Jump to content
Sign in to follow this  
jimmyjmmy

how to fill in forms of a current-active webpage

Recommended Posts

jimmyjmmy

Hi,

I wish to fill in the forms of a current webpage. So what must I assign to $url below? I already have the field names. What other ways can I achieve to fill the forms of a current webpage.

What is the command to get the url of an existing active webpage.

Thanks

#include <IE.au3>

#Include <File.au3>

$url = ; what should I put here

Dim $oIE = _IECreate ($url)

$firstname_form = _IEGetObjByName ($oIE, "txtFirstname")

$firstname_value = $firstname

_IEFormElementSetValue ($firstname_form, $firstname_value)

Share this post


Link to post
Share on other sites
Minikori

Hi,

I wish to fill in the forms of a current webpage. So what must I assign to $url below? I already have the field names. What other ways can I achieve to fill the forms of a current webpage.

What is the command to get the url of an existing active webpage.

Thanks

#include <IE.au3>

#Include <File.au3>

$url = ; what should I put here

Dim $oIE = _IECreate ($url)

$firstname_form = _IEGetObjByName ($oIE, "txtFirstname")

$firstname_value = $firstname

_IEFormElementSetValue ($firstname_form, $firstname_value)

$url should be the web address of the page. This was in the help file.

For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Share this post


Link to post
Share on other sites
DaleHohm

_IEAttach


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
jimmyjmmy

_IEAttach

Thanks,

What I want to do is to fill in the forms of a current active page. The url of this page is unkown to me because when I click a link, I was redirected to that page and I need to fill in the forms. So how do I fill in the forms of that page? This is what I have done but it wont work. Lets use yahoo sign-up form as an example. https://edit.yahoo.com/registration?.intl=u...omo=&.last=

;;;;; start of my script that wont work ;;;;;;;;;;;;;;;;;;;;;;

#include <IE.au3>

$oIE = _IEAttach ("yahoo")

$oIE = _IEPropertyGet ($oIE, "locationurl")

$firstname_form = _IEGetObjByName ($oIE, "firstname")

$firstname_value = "firstname"

_IEFormElementSetValue ($firstname_form, $firstname_value )

;;;;;; the output I got the following error ;;;;;;;;;;;;;;;

--> IE.au3 V2.4-0 Warning from function _IEAttach, $_IEStatus_NoMatch

--> IE.au3 V2.4-0 Error from function _IEPropertyGet, $_IEStatus_InvalidDataType

--> IE.au3 V2.4-0 Error from function _IEGetObjByName, $_IEStatus_InvalidDataType

--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType

Share this post


Link to post
Share on other sites
PsaltyDS

$oIE = _IEAttach ("yahoo")

;;;;;; the output I got the following error ;;;;;;;;;;;;;;;

--> IE.au3 V2.4-0 Warning from function _IEAttach, $_IEStatus_NoMatch

Nothing else matters until you fix the specification in _IEAttach() so that it will correctly find your existing instance of IE.

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  

×