Jump to content
zenocon

Current state of AutoIT / Web DOM integration

Recommended Posts

zenocon

Hi, After scouring the forums for many hours, I'm trying to compile the most up to date / recent information on the options available for integrating with JavaScript / DOM -- as it relates to scraping + automation of web pages.

It's my understanding there is IE.au3 script for automation of IE through a COM interface.  But I believe this only works with IE and won't work with Edge, correct?  Is there a COM interface that works with Edge, or any other options for integrating with Edge (other than IUIAuatomation?)

I know there was also a FF.au3 UDF, but Mozilla abandoned the support for their mozrepl in favor of Web Extensions, and my understanding is that the FF.au3 UDF no longer works, is that correct?

There was also a Chrome.au3 UDF, but my read on the forums indicate that this also broke many Chrome releases past.

Which leaves IUIAutomation which I have been using to automate / scrape Windows apps, but when I am trying it on a website, it is not as useful.  For example, if I know the exact DOM id / class, I can get at it and do whatever I need to in JavaScript very simply.  With IUIAutomation, the DOM properties are not available, and most tags / elements in DOM have no useful defining characteristics to be able to get at them reliably (if they are targetable at all).  Some things might be able to be done with IUIAutomation, but I see it's value in targeting website automation / scraping as fairly limited.

At this point, it seems like my best option is to use IE.au3, but that forces users on IE, which is probably a showstopper.

Is there another way to bridge into the DOM?  I have written Web Extensions for Chrome and Firefox before.  They can communicate with external processes via AJAX or messaging.  I'm wondering if I can build what I need in a WebExtension and then trigger it from AutoIT Script, and gather up the results somewhere.

I know there was the ISimpleDOM.au3 and some Microsoft Accessability scripts, but they seem to only be partially supported in browsers, and I didn't have a lot of luck getting those examples to run correctly.

Share this post


Link to post
Share on other sites
zenocon

Hi, After scouring the forums for many hours, I'm trying to compile the most up to date / recent information on the options available for integrating with JavaScript / DOM -- as it relates to scraping + automation of web pages.

It's my understanding there is IE.au3 script for automation of IE through a COM interface.  But I believe this only works with IE and won't work with Edge, correct?  Is there a COM interface that works with Edge, or any other options for integrating with Edge (other than IUIAuatomation?)

I know there was also a FF.au3 UDF, but Mozilla abandoned the support for their mozrepl in favor of Web Extensions, and my understanding is that the FF.au3 UDF no longer works, is that correct?

There was also a Chrome.au3 UDF, but my read on the forums indicate that this also broke many Chrome releases past.

Which leaves IUIAutomation which I have been using to automate / scrape Windows apps, but when I am trying it on a website, it is not as useful.  For example, if I know the exact DOM id / class, I can get at it and do whatever I need to in JavaScript very simply.  With IUIAutomation, the DOM properties are not available, and most tags / elements in DOM have no useful defining characteristics to be able to get at them reliably (if they are targetable at all).  Some things might be able to be done with IUIAutomation, but I see it's value in targeting website automation / scraping as fairly limited.

At this point, it seems like my best option is to use IE.au3, but that forces users on IE, which is probably a showstopper.

Is there another way to bridge into the DOM?  I have written Web Extensions for Chrome and Firefox before.  They can communicate with external processes via AJAX or messaging.  I'm wondering if I can build what I need in a WebExtension and then trigger it from AutoIT Script, and gather up the results somewhere.

I know there was the ISimpleDOM.au3 and some Microsoft Accessability scripts, but they seem to only be partially supported in browsers, and I didn't have a lot of luck getting those examples to run correctly.

Share this post


Link to post
Share on other sites
JLogan3o13

Duplicate threads merged.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
zenocon
1 minute ago, JLogan3o13 said:

Duplicate threads merged.

That's odd, I only posted it once

Share this post


Link to post
Share on other sites
JLogan3o13

It happens from time to time, no worries.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
junkew

And with iuiautomation or controlsend you can allways execute javascript thru adressbar on any browser which gives you unlimited possibilities of injecting javascripts in the page you want to act on.

1. Inject a simple script thru addressbar to make a 1x1 pixel sized textbox. For debugging make it bigger

2. Put a bunch of javascript code in the added textbox with iuiautomation

3. Eval with an addresbar javascript the content of the textbox

More examples

https://www.autoitscript.com/forum/search/?&q="javascript:"&author=Junkew

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • 31290
      By 31290
      Hi everyone, hope you are doing fine
      Well, I'm currently writing a small script that goes to a certain web page, finds the first link of a specified section and download the file associated to this link.
      Depending on the computer that the tool is launched, the script gets the computer model and search in the (provided here) ini file which link to follow.
      At first, Dell was kind enough to provide only one link but now, they provide two of them. The first one is now a .txt file (  ) whereas my script has been designed to download only the fist and latest link released for the BIOS Update.

      Here's the current code which is working with only the first and latest link of the BIOS category:
      So the question is: 
      In the case of double links like shown in the picture above, how it is possible to tell the script to download only the link containing an the .exe file?
      Of course, I could have changed the array result to [1] instead of [0] [which is working] but it seems that Dell does that randomly and that I deal with a lot of computer models.
      Thanks for the help you can provide, 
      -31290-
       
      SEE_BIOS_LINKS.ini
    • Robdog1955
      By Robdog1955
      I'm trying to click a button on a web page. I have added a couple of MsgBox lines to allow me to watch what happens on the page. As you can see the first half of my script enters data into text boxes on the page. I have no problem there. I just cannot click on the region buttons. The "set focus" line causes an outline to appear around the EU button and the "click button" line causes the "Pick a Region" text to disappear. Here is the code I have so far.
      #include <IE.au3> Local $oIE = _IECreate("http://questchecker.com/") Local $iQuestID = "123456" Local $sCharacterName = "CharacterName" Local $colForms = _IEFormGetCollection($oIE) $iCount = 0 For $oForm In $colForms $oFormElements = _IEFormElementGetCollection($oForm) For $oFormElement In $oFormElements $iCount = $iCount + 1 Local $sTagName = StringLower($oFormElement.tagName) Local $sElementType = $oFormElement.type Local $sElementName = $oFormElement.name Switch $iCount Case 6 _IEFormElementSetValue($oFormElement, "MyRealm", 0) ; realm Case 7 _IEFormElementSetValue($oFormElement, $sCharacterName, 0) Case 8 _IEFormElementSetValue($oFormElement, $iQuestID, 0) EndSwitch Next Next Local $oButtons = _IEGetObjByName($oIE, "questForm") For $oButton In $oButtons If _IEFormElementGetValue($oButton) = "US" Then MsgBox(0, "", "Click Okay to set focus") _IEAction($oButton, "focus") MsgBox(0, "", "Click Okay to click button") _IEAction($oButton, "click") ExitLoop EndIf Next MsgBox(0, "", "Click Okay to quit") _IEQuit($oIE) Exit  
    • seppedelanghe
      By seppedelanghe
      Hi everyone,
      First of all sorry for my bad english.
      I'm trying to build a automated program/autoit that controls a web app.
      I created the script using mouseclick() , but i don't want the web browser to be visible.
      I tried ControlClick() , but the web app uses flash and the buttons/items to be clicked do not have an ID.
      I searched and visited a lott of autoit post and pages (even in german  ) , but could not find a way or get it to work.
      Any help is welcome!!!
      Thanks already
      Seppe
    • UEZ
      By UEZ
      Is it somehow possible to use SVGPathElement DOM interface to convert a SVG file to polygons within AutoIt?
      load a SVG file with AutoIt convert the SVG vectors to polygons using this interface export the polygons to a file I don't know whether it works also for multi vectorized objects.
      An example is here: http://phrogz.net/svg/convert_path_to_polygon.xhtml / http://stackoverflow.com/questions/8091983/convert-path-to-polygon / https://www.w3.org/TR/SVG/paths.html#InterfaceSVGPathElement
       
      I've absolutely no experiences with this kind of stuff (you know it is not GDI+ ;-))
       
      THANKS.
    • DavidLago
      By DavidLago
      Hello.

      I'd like to ask some help with IE interaction.
      Basically, My script opens a webpage, then checks for an expected form named login and passwd:
      ; Collects info from the opened page $oForms = _IEFormGetCollection($oIE) Local $iNumForms = @extended If $iNumForms = 1 Then $oForm = _IEFormGetCollection($oIE, 0) $oObjs = _IEFormElementGetCollection($oForm) Local $iNumObj = @extended Else ; insert error treatment here Exit EndIf If $iNumObj = 3 Then ; Check if there are 3 objects in the page (login / pass / submit) Sleep(1000) ; Emulating a user typing infos $oObj = _IEFormElementGetObjByName($oForm, "login") _IEFormElementSetValue($oObj, "barackobama") Sleep(1000) ; Emulating the user $oObj = _IEFormElementGetObjByName($oForm, "passwd") _IEFormElementSetValue($oObj, "UncleSam2015") Sleep(1000) ; Emulating the user _IEFormSubmit($oForm) Else ; insert error treatment here Exit EndIf It goes to a loading screen, it usually takes 2-10 seconds. Then, it goes to a main screen dashboard.
      The ElementGetObjByName gets this info from the page:
      <input class="CTXMSAM_ContentFont" type="Password" title="Enter password" name="passwd" size="30" maxlength="127" style="width:100%;"> I need to verify if it really logs in (kinda worked around this), and how long it takes to load the main screen (that classic loading spinning ball).
      I was trying to do it by counting the forms or objects, but it's not possible, since there is no forms on the main screen, and both the loading screen and the main screen has 1 object. The main screen though, has an object already identifier (searchbox), but it also doesn't have a name. The code of the searchbox is as below:
      <input class="searchbox-textbox lighttext" type="text" autocomplete="off" title="Search"> Is there any way for me to track/identify this page with or without IE.au3?
      Thanks.
       
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.