umairrajan Posted March 19, 2015 Share Posted March 19, 2015 (edited) Hi, i am trying to read a body of an internal webpage and write its body to a txt file after performaing a search. so far i have been able to figure out how to do that but the probleum is when ever the body is written in the txt file it is from the page prrior to the search. this is the code. #include <IE.au3> Local $oIE = _IECreate("internal address") _IELoadWait ($oIE) Send("{T}{E}{S}{T}{SPACE}{A}{S}{S}{I}{G}{H}{N}{ENTER}") _IELoadWait ($oIE) $sText = _IEBodyReadText($oIE) $file = FileOpen("test.txt", 1) FileWrite($file, $sText) one more detail when the search is performed the URL doesnot change. Edited March 19, 2015 by umairrajan Link to comment Share on other sites More sharing options...
Herb191 Posted March 20, 2015 Share Posted March 20, 2015 (edited) It’s hard to say what is going on without seeing the webpage. There is a good chance IELoadWait ($oIE) is not actually waiting for the page to load after the send command. Try Sleep(10000) after the send command and see what happens. Edited March 20, 2015 by Herb191 Link to comment Share on other sites More sharing options...
MikahS Posted March 20, 2015 Share Posted March 20, 2015 _IECreate() does _IELoadWait() internally inside the function. Just a comment. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
l3ill Posted March 20, 2015 Share Posted March 20, 2015 Hi, tested, 3 different webpages | each time the text file was updated withe new page | working fine here. Maybe something on your end. +>19:39:23 Starting AutoIt3Wrapper v.2.1.4.0 SciTE v.3.3.7.0 ; Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X86 Environment(Language:0407 Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X86) My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
umairrajan Posted March 20, 2015 Author Share Posted March 20, 2015 It’s hard to say what is going on without seeing the webpage. There is a good chance IELoadWait ($oIE) is not actually waiting for the page to load after the send command. Try Sleep(10000) after the send command and see what happens. thanks. This solved it 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