HHY Posted April 1, 2008 Share Posted April 1, 2008 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 More sharing options...
HHY Posted April 1, 2008 Author Share Posted April 1, 2008 Could someone please help? i'm really stuck Link to comment Share on other sites More sharing options...
covaks Posted April 1, 2008 Share Posted April 1, 2008 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 More sharing options...
HHY Posted April 1, 2008 Author Share Posted April 1, 2008 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 More sharing options...
HHY Posted April 1, 2008 Author Share Posted April 1, 2008 Thank you very much. I will try that outIt works. Thanks a lot Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now