Jump to content

Recommended Posts

Posted

Hi everyone,

i'm very new to Autoit; this is my second day using it. I encounter this problem and hope someone can help.

I have a IE7 web page. I'd like to copy some text on that page.

For example,

The IE7 page has a lot of text. I only need to copy '77 items found'. The problem is the number '77' in the first part can be changed from time to time.

It could be like this:

77 items found --- for page 1

12 items found --- for page 2

189 items found --- for page 3

So the number is very different and changing, but the 'items found' part is remained unchanged.

How can I copy that text to the clipboard?

Please advise.

Thanks

Posted

Thank you very much. I will try that out

Get the text of the page, split it into an array, and search each line for "items found" is one way to do it. eg:

#include <IE.au3>
$oIE = _IECreate("http://whatever.com")
$sText = _IEBodyReadText ($oIE)
$aText = StringSplit($sText,@CRLF)

For $x = 1 to $aText[0]
    If StringInStr($aText[$x],"items found") Then
        msgbox(0,"",$aText[$x])
    EndIf
Next

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
×
×
  • Create New...