Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

shell.explorer ActiveX DOM syntax issue

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • shell.explorer ActiveX DOM syntax issue

    Hello all.
    I've been using the ActiveX shell.explorer2 to open web sites and log and make data entry from our database into web sites. The general method was outlined in the "screen scraping" article on learnalpha.com.

    This works fine:
    function documentcomplete as v (pDisp as P,URL as A)
    doc=web.object.document
    select
    case action_btn_label="Logon"
    action_btn_label="Search for patient"
    doc.getElementById("USERNAME")="peter"
    doc.getElementById("PASSWORD")="shazaam"
    end select
    end function

    The above code enters the username and password into the controls identified.
    My problem is that I've encountered a web site that I need to use that has no id values for the input controls, only unique names. So I need something along the lines of

    doc.getElementsByName("USERNAME").(1)="peter"

    which doesn't do anything. I've also tried
    doc.getElementsByName("USERNAME").(0)="peter"

    and a bunch of other variations without success. Anyone come across this?
    Thanks.

  • #2
    Re: shell.explorer ActiveX DOM syntax issue

    Peter:
    Instead of:
    doc.getElementsByName("USERNAME").(1)="peter"
    Try
    x=getElementsByName("USERNAME")
    put here the full qualifying name of x, for example:
    document.form1.x.value="peter"

    Comment


    • #3
      Re: shell.explorer ActiveX DOM syntax issue

      Thanks for the suggestion, Gabe, but it doesn't work either.

      Comment


      • #4
        Re: shell.explorer ActiveX DOM syntax issue

        I am going to refresh my memory on this but if all fails you could always try document.write assuming the document is not too big. Not a very elegant solution.
        If the object is a password, by that I mean written in the document as password not as a text object, the syntax would be somewhat different.
        While you are at it, try defaultvalue instead of value see if that works.

        Comment


        • #5
          Re: shell.explorer ActiveX DOM syntax issue

          Peter:
          The above syntax works for me unless the script in the document is something other than JS.

          Comment


          • #6
            Re: shell.explorer ActiveX DOM syntax issue

            The website is for Navinet, a medical site.

            Here's what I have that doesn't work:
            Code:
            DIM web as P
            dim web.object as p
            dim web.class as c
            web.class = "shell.explorer.2"
            
            dim web.events as c
            web.events = <<%code%
            
            function documentcomplete as v (pDisp as P,URL as A)
            doc=web.object.document
            select
            case action_btn_label="Logon"
               action_btn_label="Search for patient"
                doc.getElementsByName("USERNAME").(1)="peter"
            
                ' doc.getElementById("USERNAME")="peter" works when there's an id for the control
            case action_btn_label="Search for patient"
               
                 action_btn_label="Search in progress"   
            case action_btn_label="Search in progress"
                 action_btn_label=""
               
            end select
            end function
            %code%
            
            DIM web_url as c
            web_url =  "https://navinet.navimedix.com/Main.aspx"
            
            
            dlg_expanded=<<%dlg%
            {startup=init}
            {region}
            | {activex=140,35web?.t.};
            {endregion};
            {line=1,0};
            {region}
             <Close>;
            {endregion};
            %dlg%
            
            dlg_events=<<%code%
            if a_dlg_button = "init" then
                action_btn_label="Logon"
                hourglass_cursor(.t.)
                if web_url <> "" then
                    on error goto web_error
                    web.object.navigate(web_url)
                    on error goto 0
                end if
                hourglass_cursor(.f.)
            end if
            if a_dlg_button="Close" then
                ui_modeless_dlg_close("Navinet")
            end if
            end
            I tried your suggestion, Gabe, but I can't get it to put anything into the USERNAME or PASSWORD controls on the Navinet site. If you can get anything put into those fields I would be grateful for the instruction!

            Comment


            • #7
              Re: shell.explorer ActiveX DOM syntax issue

              Peter:
              navinet doesn't work with Firefox only with IE >5.5. I need to download IE v8 first. Just had a major spyware from IE, the worst I've ever seen, managed to get rid of it and try as much as I can to stay away from IE.
              I will work on it and see what I come up with.

              Comment


              • #8
                Re: shell.explorer ActiveX DOM syntax issue

                Peter:
                I opened the page source and from a quick look at it, it seems that it's one of those designed specifically to defeat screen scrapping since it deals with sensitive private patients' information. I don't know if you can use the same function here, not sure even what you can use other than the ugly send_keys perhaps.

                Have you tried using something like roboform?
                Wish I had more time to work on it. Best of luck.

                Comment


                • #9
                  Re: shell.explorer ActiveX DOM syntax issue

                  Gabe,
                  Thanks for looking. Interestingly, it seems that none of the DOM functions work with the page. It's not as I thought just a question of using the right syntax for getElementsByName(); I can't even access pointers to objects that have an Id. Not sure why.

                  Comment


                  • #10
                    Re: shell.explorer ActiveX DOM syntax issue

                    Originally posted by Peter.Wayne View Post
                    Gabe,
                    Thanks for looking. Interestingly, it seems that none of the DOM functions work with the page. It's not as I thought just a question of using the right syntax for getElementsByName(); I can't even access pointers to objects that have an Id. Not sure why.
                    Might a 'lower level scrape' work here?

                    Ie read the html into a string variable and then look for a pattern that precedes the data and then a terminating string and take the data in between - repeat as needed.
                    Al Buchholz
                    Bookwood Systems, LTD
                    Weekly QReportBuilder Webinars Thursday 1 pm CST

                    Occam's Razor - KISS
                    Normalize till it hurts - De-normalize till it works.
                    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                    When we triage a problem it is much easier to read sample systems than to read a mind.
                    "Make it as simple as possible, but not simpler."
                    Albert Einstein

                    http://www.iadn.com/images/media/iadn_member.png

                    Comment


                    • #11
                      Re: shell.explorer ActiveX DOM syntax issue

                      Hi Al,
                      It's not reading the page that's important -- it's writing to the input controls. I need pointers to the control objects to write to them.
                      - Peter

                      Comment


                      • #12
                        Re: shell.explorer ActiveX DOM syntax issue

                        Originally posted by Peter.Wayne View Post
                        Hi Al,
                        It's not reading the page that's important -- it's writing to the input controls. I need pointers to the control objects to write to them.
                        - Peter
                        Yes, but can you find the pointer/info by reading the html and then setting up pointers from that?

                        Sounds like something in the activex isn't playing well with that site.

                        You might be eliminating the need for the activex...
                        Al Buchholz
                        Bookwood Systems, LTD
                        Weekly QReportBuilder Webinars Thursday 1 pm CST

                        Occam's Razor - KISS
                        Normalize till it hurts - De-normalize till it works.
                        Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                        When we triage a problem it is much easier to read sample systems than to read a mind.
                        "Make it as simple as possible, but not simpler."
                        Albert Einstein

                        http://www.iadn.com/images/media/iadn_member.png

                        Comment


                        • #13
                          Re: shell.explorer ActiveX DOM syntax issue

                          I found the issue -- the page is opened in an iframe, and the object pointer has to go through the iframe. I'm still working on the right method but I'm making progress. Thanks to those who helped.

                          Comment

                          Working...
                          X