473,604 Members | 2,710 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 3067

"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
1638
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
3304
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
3345
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
3866
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
3682
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
4516
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
1832
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
2574
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
3224
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
7997
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
8406
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8065
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
6737
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5882
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
5441
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
3906
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3954
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.