Jump to content

copy text from IE7


 Share

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

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