473,408 Members | 2,027 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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 3042

"Greg Grin" <gr*****@yahoo.com> wrote in message
news:eb**************************@posting.google.c om...
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('InternetExplorer.Application')

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.Document.forms[0].elements.all[username].value =
"YourUsername"
ieBrowser.Document.forms[0].elements.all[password ].value =
"YourPassword"
ieBrowser.Document.forms[0].elements.all[SubmitButtonName].form.submit()

You can get the actual names for your username, password and
SubmitButtonName 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
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...
10
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...
10
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...
4
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,...
3
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...
9
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...
2
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");...
5
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...
1
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
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...
0
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...

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.