The emergence of the Python programming language brings a different development experience to developers. Here, we will analyze the application methods and features of this programming language from an important Python PAMIE module, hoping to help you.
PAMIE is called Python automation Module For Internet Explorer. As its name suggests, PAMIE is a Module that implements IE automation. The official website of PAMIE provides download of the latest modules. However, due to personal development, other documents, FAQs, and other issues are not updated. After downloading the latest version, many of the materials provided on the home page are incorrect. You must pay attention to this when using the materials. The most obvious example is what I mentioned in the previous article, some methods have been replaced. Check PAM30.py for more information!
The following uses PAMIE Test Page as an example to illustrate the use of some basic methods.
In the latest version, the class name in PAM30.py has been changed to PAMIE. the previously used import cPAMIE or from cPAMIE import PAMIE will obviously fail. from PAM30 import PAMIE
Create a Python PAMIE module instance
Ie = PAMIE ()
Open webpage
Ie. navigate ('HTTP: // pamie.sourceforge.net/pamieform.html ')
To view the page source code when processing page elements, we recommend Internet Explorer Developer Toolbar, which is easy to locate and find web elements,
Text Box
Ie. setTextBox ('firstname', 'firstname ')
Ie. setTextBox ('lastname', 'lastname ')
Select the drop-down menu:
Ie. selectListBox ('state', "MS ")
Square selection box:
Ie. setCheckBox ('cxbx ', 1) #1 2 3 or * are all "checked" meaning ''Null String indicates unselected
Circle selection box:
Select Jazz
Ie. setRadioButton ("music", "Jazz") # music is the name of the selection list. Find it from the source code of the webpage.
Last submit button
Ie. clickButton ("Submit ")
The preceding section describes the Python PAMIE module.