Sign in to follow this  
Followers 0
screamer21

noob needs help with parts of coding

5 posts in this topic

i got autoit v3 and know some basic stuff, but have no clue on how to do the following:

first i need autoit to open a web browser aka chrome

then i need it to go to a specific url

next i need to have it login as me say foofoo password

then i can enter stuff (this part i figured out with mouse point n click commands.)

then when finished have it close the browser, and wait for a specific amount of time. before repeating.

is there alot of coding for this part? i saw the login forum post, but am not sure if that is for web pages or database login,

sample code would be perfect. to give me an idea where to go.

Share this post


Link to post
Share on other sites



Hello screamer21,

Welcome to AutoIt!

Being a beginner, I'd suggest working with Internet Explorer. Reason being is there is a well defined UDF for it. There is also one for Firefox, but I have yet to see one created for Chrome.

With the UDF "IE.au3" you can use commands like:

_IECreate() ; Which will Create/open an Internet Explorer Bowswer Window

_IENavigate() ; Which will navigate to the page/site you need.

With a little trial and error you can use these next functions to obtain the controls ID's and use them to log yourself in with your own credentials:

_IEFormElementCollection(), _IEFormElementGetCollection(), _IEFormElementSetValue(), _IEFormSubmit()

The IE.au3 UDF also has many great functions to manipulate the pages as well like:

_IELinkClickByText(), _IELinkClickByIndex(), _IEImgClick() ; For clicking links on the page.

There are many other great and useful functions in the IE.au3 UDF, which is in your 'Include' Folder that came with the download, and documentation can also be found under 'IE Management' in the 'User Defined Functions Refrence of your Help File.

Good Luck,

Realm


My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.  

Share this post


Link to post
Share on other sites

thanks for the information. i found some great examples of this in the code forum. was looking at it and fount it useful. 403 has great tutorials on a gui interface i did not even know about. i will use the ie.au3 for now. the reason i needed the window closed and reopened is because of my $#%# router. if it hiccups, the router makes me have to close and reopen the browser to continue my work. the rest is simply repeditive ont the hour web updating for my web site.

could not find much on chrome anyhow. but ie is working fine. only thing left is to close the program. i will continue looking at the vast amount of scripts, im sure its here somewhere.

thanks for your reply. btw i hate ie... lol

Share this post


Link to post
Share on other sites

I'm not a fan of IE either, I tend to use Firefox on most of my surfing, and Chrome with my trusted sites. However the documentation on the FF UDF is fairly vague, and not used enough to get good support on issues here, where IE.au3 is much easier to find support on. I'm sure someone will eventually breakdown the Chrome API and write a UDF for it.

Also, you don't have to use the actual IE Browser...you can create your own with AutoIt and just use the IE engine to manipulate it. A small example of an embedded window can be found in the same IE Management section, and the function with an example is called _IECreateEmbedded().

Enjoy!

Realm


My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.  

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

here's a very simple and basic script I've created for my personal laptop

It opens the browser and opens several webpages in Firefox, waits for my Gmail login page to populate and then enters my Gmail account username and password

I have changed my username and password (duh!)

I adapted this to use IE

You can add to the script to Sleep ( milliseconds ) then close IE

$IExplorer = @ProgramFilesDir & '\Internet Explorer\IExplore.exe'
Run ( $IExplorer & ' https://mail.google.com' )
WinWaitActive ( 'Gmail: Email from Google', '' )
Send ( 'foofoo' )
Send ( '{TAB}' )
Send ( 'foofoopassword')
Send ( '{TAB 2}' )
Send ( '{SPACE}' )
Sleep ( 5000 ) ; waits 5 seconds
ProcessClose ( 'IExplore.exe' )
Exit

If you want to open the site maximized, I have another script that will do that for you, I don't have it with me at home though, it's a work

Just let me know if you want to open it maximized...

Hope this helps!

Edited by Elephant007

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