Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Reading text from a screen and applying conditionals


  • Please log in to reply
2 replies to this topic
rajk
  • Members
  • 4 posts
  • Last active: Jan 04 2013 07:48 AM
  • Joined: 27 Dec 2012

Hi,

I would like my script to read the text from a certain part of the screen, then use that text in a conditional to react accordingly. 

The website is made with Bootstrap and I believe it uses JavaScript. I want the script to read from that box only and place the first 10 words into a variable. Is this possible? I was looking at the WinGetText function but I can't seem to make it record text from only that section.

 

http://grab.by/iA4I

 

Thanks!



nimda
  • Members
  • 4368 posts
  • Last active: Jan 15 2014 02:47 PM
  • Joined: 26 Dec 2010

Web browsers are special. They work on a lower level than the WinAPI, so WinGetText won't work. You have 2 options:

- Automate an Internet Explorer browser using COM. This gives you access to the whole HTML of the website, plus the DOM (if you've ever written javascript this should be familiar).

- Use Optical Character Recognition. This simply takes a screenshot and tries to read what's on it. Not exactly reliable.



rajk
  • Members
  • 4 posts
  • Last active: Jan 04 2013 07:48 AM
  • Joined: 27 Dec 2012

Okay. Thanks. I ended up using Ctrl A Ctrl C to get the text.