I'm having trouble with a search call using regexp with the imacros/ie browser to retrieve the full source of a webpage.
My automation is with c# ... the rest of the application works great.
Imacros version ... VERSION BUILD=10002738
Browser Versions ...
IE v10.0.14
CR v34.0.1847.137 m
I found http://forum.imacros.net/viewtopic.php?f=7&t=11200, which gives 2 different methods for pulling the full web page source out of a SEARCH statement.
1) SEARCH SOURCE=REGEXP:"(?s)(.*)" EXTRACT="$1" ... doesn't seem to work anywhere
2) SEARCH SOURCE=REGEXP:"([\s\S]*)" EXTRACT="$1" ... seems to work in Chrome, but not the iMacros Browser / Internet Explorer ... it however does lockup the chrome browser on occasion.
and
3) TAG POS=1 TYPE=HTML ATTR=TXT:* EXTRACT=HTM ... I don't like the output of this approach
What I really want is a SEARCH line that I can plug into a dynamically built macro that will give me the full sourcecode of a webpage.
My ultimate goal is to know when a search form returns ... the problem is that the search form is submitted with a javascript overlay that gives an "in-progress" type of spinning wheel. Once the search is complete the information is most likely returned into an embedded DIV so the page doesn't really "reload". So what I'd like to do is get the full sourcecode of the original page before the search button is clicked, and then get it again after a set amount of time and compare the 2.
Here's the basic code that I'm using to setup a while true loop in c# to constantly monitor the source to know when it changes ...
Code: Select all
s = mApp.iimPlayCode(Constants.Search);
while (true)
{
s = mApp.iimPlayCode(Constants.WaitforSearch, 5);
System.Threading.Thread.Sleep(5000);
extract = mApp.iimGetLastExtract();
if (extract.ToString() != first_page)
{
break;
}
}
Code: Select all
internal const string WaitforSearch =
"VERSION BUILD=10002738" + "\r\n" +
"TAB T=1" + "\r\n" +
"TAB CLOSEALLOTHERS" + "\r\n" +
"WAIT SECONDS=4" + "\r\n" +
//"TAG POS=1 TYPE=HTML ATTR=TXT:* EXTRACT=HTM" + "\r\n" +
//"SEARCH SOURCE=REGEXP:\"(?s)(.*)\" EXTRACT=\"$1\"" + "\r\n" +
"SEARCH SOURCE=REGEXP:\"([\\s\\S]*)\" EXTRACT=\"$1\"" + "\r\n" +
"";
Thanks all ...
DJW