Sign in to follow this  
Followers 0
meamrussian

How To Find Exact Spot To Type Text

10 posts in this topic

#1 ·  Posted (edited)

I'm trying to make a script that automatically types text into specified areas. Let's say that I want some text to be typed in a forum. How do I make it "find" the location to type in the title/subject? And then, automatically find the place to type the body text into?

At first, I used send({tab}) multiple times to get to the right boxes, but after learning about opening default browsers, I learned that for each browser the tab goes to different places. So, I'm looking for a way to type $subject into the subject line of posting a post, and $post into the actualy message post of a forum. So, any way to find exact locations so it will work with any browser?

Edited by meamrussian

Share this post


Link to post
Share on other sites



I'm trying to make a script that automatically types text into specified areas. Let's say that I want some text to be typed in a forum. How do I make it "find" the location to type in the title/subject? And then, automatically find the place to type the body text into?

At first, I used send({tab}) multiple times to get to the right boxes, but after learning about opening default browsers, I learned that for each browser the tab goes to different places. So, I'm looking for a way to type $subject into the subject line of posting a post, and $post into the actualy message post of a forum. So, any way to find exact locations so it will work with any browser?

<{POST_SNAPBACK}>

alot of variables there... different web pages display things in diff places etc....one thing you could try is using inetget() to save the page locally, then parse it out to find the field names in the form, and assign the text you want to type to the specified values in the html file, then call the form's action url, or posting page from the submit button with the values you've assigned. working directly with the html locally in the background that way will eliminate alot of the inconsistencies with different browsers etc.


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

alot of variables there... different web pages display things in diff places etc....one thing you could try is using inetget() to save the page locally, then parse it out to find the field names in the form, and assign the text you want to type to the specified values in the html file, then call the form's action url, or posting page from the submit button with the values you've assigned.   working directly with the html locally in the background that way will eliminate alot of the inconsistencies with different browsers etc.

<{POST_SNAPBACK}>

OK, let's say I've saved the page, and the input for the title of the new post was the following:

<td><input class="bginput" name="subject" value="" size="40" maxlength="85" tabindex="1" type="text"></td>

How would I make autoit find that and insert text into that?

<textarea name="message" id="message" rows="20" cols="60" wrap="virtual" style="width: 540px; height: 250px;" tabindex="1"></textarea>

That would be the text area

Edited by meamrussian

Share this post


Link to post
Share on other sites

OK, let's say I've saved the page, and the input for the title of the new post was the following:

<td><input class="bginput" name="subject" value="" size="40" maxlength="85" tabindex="1" type="text"></td>

How would I make autoit find that and insert text into that?

<textarea name="message" id="message" rows="20" cols="60" wrap="virtual" style="width: 540px; height: 250px;" tabindex="1"></textarea>

That would be the text area

<{POST_SNAPBACK}>

assuming that this is the only page you'll be posting to, you could parse the locally saved copy for the 'name="subject" value="" ' string, adding everything before the last " of that substring to a temporary file, then inject your subject, then continue... as far as actually submitting the form with new values etc. Once the tempfile is completely written, with your values where you want them, just save it with html extension and open it, then click submit button. or a prettier solution would be to call your browser with the submit address and the values... if you want to see an example of a similar idea, check out post #91722 (sorry i'm not a big forum user so don't know how to link directly to the thread) it's about a program i made to handle spool files displayed on a dynamic web page. i have all of the code there for how i would read in a list of spool files, put the list to a combo box, then either pull and parse or display the spool files. either of which required submitting the form without actually having the browser up on screen.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

cameronsdad, I'm still kinda new to AutoIt... I'm not sure if I understand what you said... sorry :)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

cameronsdad, I'm still kinda new to AutoIt... I'm not sure if I understand what you said... sorry :)

<{POST_SNAPBACK}>

no problem. i may be explaining it weird too. check out this thread Dynamic Combo Box. there is some code there for a program i made that worked wtih saved web pages and forms. Edited by cameronsdad

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

no problem.  i may be explaining it weird too.  check out this thread Dynamic Combo Box.  there is some code there for a program i made that worked wtih saved web pages and forms.

<{POST_SNAPBACK}>

Your link is not there (page not found)

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Here's a corrected link.

<{POST_SNAPBACK}>

thanks lxp

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

I'm trying to make a script that automatically types text into specified areas. Let's say that I want some text to be typed in a forum. How do I make it "find" the location to type in the title/subject? And then, automatically find the place to type the body text into?

<{POST_SNAPBACK}>

Sorry I'm late replying here -- didn't realize you were talking about working in a browser...

I'd suggest that you use the IE Automation UDF Library I'm working on.

I posted an example here that you should easily be able to adapt for your situation.

Dale


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

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