473,672 Members | 2,548 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

imitating user input

I need to imitate keyboard strokes in an active window inside of
internet explorer, specifically I need my program to log on to a
chatroom without me actually sitting in front of my computer. Also,
once it has logged on to the program I need my program to "read"
(search for strings, etc.) the text that's entered by other users in
this "chatroom". The problem I have is actually logging in to the
chatroom since I have not found a way to duplicate keyboard strokes.
If someone could point me in the right direction on tutorials about
this or show me a sample program that does this I would really
appreciate it.
--grigri9

P.S. I am a first semester programming student at my high school and
Python is the only language I know.
Jul 18 '05 #1
4 3071

"Greg Grin" <gr*****@yahoo. com> wrote in message
news:eb******** *************** ***@posting.goo gle.com...
I need to imitate keyboard strokes in an active window inside of
internet explorer, specifically I need my program to log on to a
chatroom without me actually sitting in front of my computer. Also,
once it has logged on to the program I need my program to "read"
(search for strings, etc.) the text that's entered by other users in
this "chatroom". The problem I have is actually logging in to the
chatroom since I have not found a way to duplicate keyboard strokes.


For this problem, you do *not* need to imitate keystrokes (and mouseclicks)
in the way that you would for interacting with a local interactive program.
You *do* need to send and receive strings through internet sockets
according to the Internet Relay Chat protocol (assuming that that is the
protocol used by the site you are interested in. There are existing chat
programs that can be scripted in Python. The Python-coded Twisted package
also includes an IRC implementation. Some of the other internet packages
may also.

Look at
http://twistedmatrix.com/users/jh/te...ocols.irc.html
or google Python Internet Relay Chat protocol, as I did, for more.

Terry J. Reedy


Jul 18 '05 #2
Hello Greg,
I need to imitate keyboard strokes in an active window inside of
internet explorer, specifically I need my program to log on to a
chatroom without me actually sitting in front of my computer. Also,
once it has logged on to the program I need my program to "read"
(search for strings, etc.) the text that's entered by other users in
this "chatroom". The problem I have is actually logging in to the
chatroom since I have not found a way to duplicate keyboard strokes.

I agree with the other response, however if you're interested in
generating key strokes anyhow have a look at AutoIt
(http://www.hiddensoft.com/AutoIt/). You can use either the executable
by generating scripts or the ActiveX component (or even the dll with
ctypes).

HTH.
Miki
Jul 18 '05 #3
Try This:

Rob Marchetti: Pamie [Pamie allows you to write Python scripts in
order to drive Internet Explorer. Pamie is a lite Python port of SAMIE
written in Perl by Henry Wasserman. This is a "free" open-source tool
written for QA engineers or developers as a means to simulate users
exploring a web site. ]

http://pamie.sourceforge.net/
Jul 18 '05 #4
Greg,

There are lots of ways to do this. Pamie is just one method.
basically you want to set the value of a two textboxes and submit the
form.

If you have an instance of the browse you can access it's methods and
attributes.

In Python you could do it this way:

#Instantiate a new instance of the IE browser:
ieBrowser = DispatchEx('Int ernetExplorer.A pplication')

Now you have access to the textboxes and it's buttons
Since you have and instance of the browser ieBrowser you can begin:

For example a simple login page with username textbox, password
textbox and submit button.

ieBrowser.Docum ent.forms[0].elements.all[username].value =
"YourUserna me"
ieBrowser.Docum ent.forms[0].elements.all[password ].value =
"YourPasswo rd"
ieBrowser.Docum ent.forms[0].elements.all[SubmitButtonNam e].form.submit()

You can get the actual names for your username, password and
SubmitButtonNam e from viewing the source of the Webpage and doing a
find on the word "input"

You can do the above in Perl VB ruby etc.. although the syntax may be
a little different.

Hope this helps.

Enjoy

RLM
Pamie creator


For more information:
http://msdn.microsoft.com/library/de...ence_entry.asp
Jul 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1639
by: Diane Yocom | last post by:
I have an ASP intranet application that is required to produce Word documents merged with data from a database. I originally looked at automating Word's mail merge capabilities, but nixed that idea since I learned it's not a good idea to try to automate Word on the server and I'd rather not have to worry about whether or not the user has Word on their machines. I, instead, decided to have the Word templates saved as RTF files and to...
10
3306
by: Ian Rastall | last post by:
I've been rooting about in the W3Schools CSS2 reference, and can't find what I'm looking for. I have a client who wants a site with a top frame, to contain the nav links, and I was thinking that maybe this could be done with CSS. IOW, to reproduce that top "frame" in every page, perhaps as an SSI, and to keep it fixed, so the rest of the page scrolls underneath it. Is this possible, and if so, how? Ian
10
3349
by: jeff regoord | last post by:
A user inputs a float value. The scanf() function gets the value. However, I need to create an error handler with an if else statement saying invalid input if the input is not a number. Does anybody know how I could do this?
4
3870
by: santa19992000 | last post by:
can I use scanf to get input (some times user enters input sometimes not, just hit keyboard)?. It displays to enter IP address, if user wants to change, then he enters, otherwise he hits keyboard, which should prompt next one, how can I do in C program?. Thanks. enter IP address:
3
3693
by: dei3cmix | last post by:
Hey, I am having a problem with a program I am working on. Basically, the first part of the program gets input from a file using cin.getline. Then the second part, (still in the same main as the first part) needs to get input from the user, and I want to do this with cin.getline also. The problem I am getting, is when I run the program, the text if read in from the file correctly, but it seems to just skip over the cin.getline when I want...
9
4519
by: MadingS | last post by:
Is there an HTML (or CSS) way to say "use the user's INPUT font, whatever that might be."? Most browsers have the ability for the user to pick his or her own preference for what font to use inside of <INPUTtags. My question is, is there a way in HTML or StyleSheet language to say something like this: <h4>Here are some values - some are hardcoded, and others are input feilds:</h4> <FONT face="same as user's input font preference"...
2
1839
by: underground | last post by:
Hi, everyone I've been trying to figure out a way for a user to update there information. I'm using sections to identify the specific user..Here is the form <? include("include/session.php"); ?> <? $username="xxxxxx"; $password="xxxxxxx"; $database="xxxxx";
5
2575
by: no1zson | last post by:
I have been reading through many of the array questions and cannot find one that addresses my issue. Maybe someone can help me out. Same story, I am learning Java and have just written a CD Inventory application. It works, does what I want it to and all that, but now I need to put an array in there to store more than one cd at a time. Seems simple enough until I actually start coding. I want to save as much of the code as I can since I worked...
1
3237
by: kang jia | last post by:
hi when user entered particulars in signuppage and click" signup" button, i will direct them to do_signup.php. if say the NRIC is dupicate in datebase, i will redirect them back to signup page again to re-signup, however, i would like to remain all the correct infromation, and let users re-entered their NRIC. how can i do this. can i use Session, but it seems cant work. any one can help me? my code in signup page is like this: ...
0
8505
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8947
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8645
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8699
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6261
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5722
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4442
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2844
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.