Python / PAMIE

Discussion in 'Python' started by frankrentef, Jul 24, 2008.

  1. frankrentef

    frankrentef Guest

    Can someone help with a PAMIE issue? I'm new to Python / PAMIE and
    they seem like great tools but to be honest I'm finding that no
    responses to questions can be found (Experts Exchange, etc.) I'm
    hoping this will be the place.



    I tried to duplicate the authors "ie.writeScript" function shown at



    http://showmedo.com/videos/video?name=pythonMarchettiPamie3&fromSeriesID=25





    I get "Attribute not found." I found one reference to where the
    command was written as "ie.scriptWrite" but that does not work either.



    I've emailed the author, Experts Exchange and other sites with ZERO
    responses.



    Can someone PLEASE assist?



    THNX
     
    frankrentef, Jul 24, 2008
    #1
    1. Advertising

  2. frankrentef

    Tim Golden Guest

    frankrentef wrote:
    > Can someone help with a PAMIE issue? I'm new to Python / PAMIE and
    > they seem like great tools but to be honest I'm finding that no
    > responses to questions can be found (Experts Exchange, etc.) I'm
    > hoping this will be the place.
    >
    > I tried to duplicate the authors "ie.writeScript" function shown at
    >
    > http://showmedo.com/videos/video?name=pythonMarchettiPamie3&fromSeriesID=25


    I'd rather you posted the code you've tried.
    I'm not too keen on viewing a video just to get
    hold of a piece of code, and in any case that
    would only show me what the author's done.

    We need to see what you've done, and what the
    traceback was. Would you mind posting some code,
    please?

    Thanks

    TJG
     
    Tim Golden, Jul 24, 2008
    #2
    1. Advertising

  3. frankrentef

    Tim Golden Guest

    frankrentef wrote:
    > Can someone help with a PAMIE issue? I'm new to Python / PAMIE and
    > they seem like great tools but to be honest I'm finding that no
    > responses to questions can be found (Experts Exchange, etc.) I'm
    > hoping this will be the place.
    >
    > I tried to duplicate the authors "ie.writeScript" function shown at
    >
    > http://showmedo.com/videos/video?name=pythonMarchettiPamie3&fromSeriesID=25


    I'd rather you posted the code you've tried.
    I'm not too keen on viewing a video just to get
    hold of a piece of code, and in any case that
    would only show me what the author's done.

    We need to see what you've done, and what the
    traceback was. Would you mind posting some code,
    please?

    Thanks

    TJG
     
    Tim Golden, Jul 24, 2008
    #3
  4. frankrentef

    frankrentef Guest

    On Jul 24, 10:07 am, Tim Golden <> wrote:
    > frankrentef wrote:
    > > Can someone help with a PAMIE issue?  I'm new to Python / PAMIE and
    > > they seem like great tools but to be honest I'm finding that no
    > > responses to questions can be found (Experts Exchange, etc.)  I'm
    > > hoping this will be the place.

    >
    > > I tried to duplicate the authors "ie.writeScript" function shown at

    >
    > >http://showmedo.com/videos/video?name=pythonMarchettiPamie3&fromSerie....

    >
    > I'd rather you posted the code you've tried.
    > I'm not too keen on viewing a video just to get
    > hold of a piece of code, and in any case that
    > would only show me what the author's done.
    >
    > We need to see what you've done, and what the
    > traceback was. Would you mind posting some code,
    > please?
    >
    > Thanks
    >
    > TJG


    THNX for your response. Based on the authors code it's very simple.

    from cPAMIE import PAMIE
    ie=PAMIE ()

    #ie.navigate ("google.com")

    #ie.linkClick
    #ie.textBoxSet
    #ie.writeScript

    ie.navigate ('https://login.yahoo.com/config/mail?.intl=us')
    #ie.scriptWrite ()

    ie.scriptWrite()


    Below is the error I get...

    File "C:\Python24\lib\site-packages\cPAMIE.py", line 1837, in
    scriptWrite
    nameProp = getattr(x,"nameProp")
    File "C:\Python24\Lib\site-packages\win32com\client\dynamic.py",
    line 500, in __getattr__
    raise AttributeError, "%s.%s" % (self._username_, attr)
    AttributeError: <unknown>.nameProp
     
    frankrentef, Jul 24, 2008
    #4
  5. frankrentef

    Tim Golden Guest

    frankrentef wrote:
    > THNX for your response. Based on the authors code it's very simple.
    >
    > from cPAMIE import PAMIE
    > ie=PAMIE ()
    >
    > #ie.navigate ("google.com")
    >
    > #ie.linkClick
    > #ie.textBoxSet
    > #ie.writeScript
    >
    > ie.navigate ('https://login.yahoo.com/config/mail?.intl=us')
    > #ie.scriptWrite ()
    >
    > ie.scriptWrite()
    >
    >
    > Below is the error I get...
    >
    > File "C:\Python24\lib\site-packages\cPAMIE.py", line 1837, in
    > scriptWrite
    > nameProp = getattr(x,"nameProp")
    > File "C:\Python24\Lib\site-packages\win32com\client\dynamic.py",
    > line 500, in __getattr__
    > raise AttributeError, "%s.%s" % (self._username_, attr)
    > AttributeError: <unknown>.nameProp



    I'm afraid I'm no IE expert (read: never use it if I can
    avoid it) but I suspect here a combination of slightly
    flaky code in the Python module plus, maybe, a change in
    the IE dom object model.

    If you change lines 1832-1836 of cPAMIE.py to be as follows:

    <patch>
    for j in range(doc.length):
    x = doc[j]
    etype = getattr(x,"type", "")
    name = getattr(x,"name", "")
    nameProp = getattr(x,"nameProp", "")

    </patch>


    then at least some kind of output is produced. But I'm
    not entirely sure what this function is trying to achieve
    so I don't guarantee it's doing the right thing yet.

    TJG
     
    Tim Golden, Jul 24, 2008
    #5
  6. frankrentef

    frankrentef Guest

    On Jul 24, 10:45 am, Tim Golden <> wrote:
    > frankrentef wrote:
    > > THNX for your response.  Based on the authors code it's very simple.

    >
    > > from cPAMIE import PAMIE
    > > ie=PAMIE ()

    >
    > > #ie.navigate ("google.com")

    >
    > > #ie.linkClick
    > > #ie.textBoxSet
    > > #ie.writeScript

    >
    > > ie.navigate ('https://login.yahoo.com/config/mail?.intl=us')
    > > #ie.scriptWrite ()

    >
    > > ie.scriptWrite()

    >
    > > Below is the error I get...

    >
    > >  File "C:\Python24\lib\site-packages\cPAMIE.py", line 1837, in
    > > scriptWrite
    > >     nameProp = getattr(x,"nameProp")
    > >   File "C:\Python24\Lib\site-packages\win32com\client\dynamic.py",
    > > line 500, in __getattr__
    > >     raise AttributeError, "%s.%s" % (self._username_, attr)
    > > AttributeError: <unknown>.nameProp

    >
    > I'm afraid I'm no IE expert (read: never use it if I can
    > avoid it) but I suspect here a combination of slightly
    > flaky code in the Python module plus, maybe, a change in
    > the IE dom object model.
    >
    > If you change lines 1832-1836 of cPAMIE.py to be as follows:
    >
    > <patch>
    >             for j in range(doc.length):
    >                 x = doc[j]
    >                 etype = getattr(x,"type", "")
    >                 name = getattr(x,"name", "")
    >                 nameProp = getattr(x,"nameProp", "")
    >
    > </patch>
    >
    > then at least some kind of output is produced. But I'm
    > not entirely sure what this function is trying to achieve
    > so I don't guarantee it's doing the right thing yet.
    >
    > TJG- Hide quoted text -
    >
    > - Show quoted text -


    The idea is to run through a given url, detect any "form fields" that
    require populating and build a script listing the field names, etc.
    From there a PAMIE user can take the script returned and build a test
    case. In other words the user does not have to search through the
    HTML code for all the field names (blanks) radio button names, etc.

    It works "great" on the video tutorial but dang if I or any of our
    senior guys can get it to work here in house. THNX for input, we'll
    give it a try.
     
    frankrentef, Jul 24, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    424
  2. scrimp
    Replies:
    10
    Views:
    1,842
  3. saltima
    Replies:
    0
    Views:
    448
    saltima
    May 2, 2006
  4. frankrentef

    Python / PAMIE - scriptWrite Function

    frankrentef, Jul 29, 2008, in forum: Python
    Replies:
    1
    Views:
    317
    frankrentef
    Jul 29, 2008
  5. frankrentef
    Replies:
    1
    Views:
    347
    coldpizza
    Feb 20, 2009
Loading...

Share This Page