Jump to content

Recommended Posts

Posted (edited)

I'm trying to capture text from a certain area on a webpage.  I could parse the entire page if necessary.

Problem is that AutoItWindowinfo spy can't see anything on the page besides the windows title.  If I try WinGetText different browsers yield different info.

With Chrome, all I get is "Chrome Legacy Window"

With Edge, I get is "Microsoft Edge" and Edge is able to Read Aloud the data, so I'm not sure what the means.

With IE, I get a little more, including the Title, the Address, and the title of the tab.

If I try to use any of the Developer Tools, the actual data isn't on the page.  The actual webpage is a "live" display of some information contained on my Mikrotik router.  I'm trying to recognize changes in the display, and store those changes,

If there's a character recognition tool, working with bitmaps would be painful, but possible?

Edited by jimg
Posted

_IEBodyReadText yields "0".

AutoIt is about my paygrade so using UIAutomation or Webdriver looks unlikely, unless the many returns when I google them are all not the ones I'm looking for.  It would be easier to take a screen shot every few minutes and manually scan them for changes 🙂

Posted

It turns out I can select the text by either Ctrl-A'ing the window or dragging the mouse across the area.  I think I can work with that (note "I think").

Posted (edited)

With the developer tools, it looks like there is an iframe but the data I'm trying to see is not within it.

I think that Chrome's "View Source" is actually retrieving the initial login page, rather than the page displayed.  I'm viewing the page through a VPN connection to the router, so there may be some sort of security lockout.

Edited by jimg
Posted

The PPP/Active connections.  I have a bunch of fixed road warriors, plus my wife, who might connect from a few spots.  I'm tired of the brute force attacks on the L2TP open ports, so I want to firewall unknown IPs.  

Posted

I can't test Active Connections because there aren't any on this demo site. However, this works for the Profiles tab --

#include <IE.au3>
#include <Array.au3>

$oIE = _IECreate("http://demo2.mt.lv/webfig")

Do
    Sleep(1000)
    $oElement = _IEGetObjById($oIE, "id_PPP")
Until IsObj($oElement)

_IEAction($oElement, "click")
Sleep(1000)

_IELinkClickByText($oIE, "Profiles") ; Change to "Active Connections"
Sleep(1000)

$oTable = _IETableGetCollection($oIE, 5)
$aTableData = _IETableWriteToArray($oTable, True)
_ArrayDisplay($aTableData)

Change the one line plus the URL and you should be able to test on your own server.

Posted

My page needs a username:password and I'll need to figure that out when I have a little more time.  Thanks for the sample, and I'll let you know if it works.

Posted

I just did a SEND of the password and your script worked perfectly.  When you don't use Autoit very often and you get old, your brain obviously atrophies.

Thanks very much!

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...