Can't ClickTag with WebRecorder

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Can't ClickTag with WebRecorder

Post by Jerry Thomas » Fri Apr 01, 2011 3:34 pm

I am trying to automate equation verifiction through WolframAlpha (a great site for math questions).
http://www.wolframalpha.com/input/?i=Sin(1)

I can put in new equations fine. The problem is in trying to click the [=] button on the right side of the entry field.

Here is the code. Any suggestions?

Code: Select all

MouseMove>0,0
Let>delay=1
IE_Create>0,IE[0]

IE_Navigate>%IE[0]%,http://www.wolframalpha.com/input/?i=1,r
IE_Wait>%IE[0]%,r
Wait>delay

Let>FrameName={""}
Let>FormName={""}
Let>FieldName={"i"}
Let>FieldValue={"Sin(1)"}
IE_FormFill>%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0,r

IE_Wait>%IE[0]%,r
Wait>delay

//These are some of the approaches I have tried...
**BREAKPOINT**
Let>DIV1_SIZE=9999
IE_ExtractTagByName>%IE[0]%,,DIV[1],,0,DIV1,r
MidStr>r_6,1,r,DIV1

Let>DIV1_SIZE=9999
IE_ExtractTagByName>%IE[0]%,,DIV,,0,DIV1,r

Let>INPUTEqual_SIZE=9999
IE_ExtractTagByName>%IE[0]%,,INPUT,equal,0,INPUTEqual,r

Let>INPUTCompute_SIZE=9999
IE_ExtractTagByName>%IE[0]%,,INPUT,compute,0,INPUTCompute,r

IE_ClickTag>%IE[0]%,,,INPUT,TITLE,compute,result1
IE_ClickTag>%IE[0]%,,,INPUT,ID,equal,result2
IE_ClickTag>%IE[0]%,,,INPUT,NAME,equal,result3
IE_ClickTag>%IE[0]%,,,INPUT,TYPE,submit,result4
Thanks,
Jerry

[email protected]

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Apr 01, 2011 3:46 pm

This works for me:

Let>FrameName={""}
Let>FormName={""}
Let>FieldName={"i"}
Let>FieldValue={"Sin(1)"}
IE_FormFill>%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,submit,r
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Post by Jerry Thomas » Fri Apr 01, 2011 4:36 pm

My mistake-bad example

Code: Select all

Change this line 
Let>FieldValue={"Sin(1)"} 

to this 

Let>FieldValue={"3+1"} 

You will see that it doesn't get submitted.
Thanks,
Jerry

[email protected]

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Fri Apr 01, 2011 6:05 pm

Code: Select all


VBSTART
VBEND

Let>FieldValue={"3+1"} 
VBEval>escape("%FieldValue%"),FieldValue

Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Post by Jerry Thomas » Fri Apr 01, 2011 6:08 pm

We are verifying the math in our CAD program and want an acknowledged expert (WolframAlpha, Mathematica, etc.). There are even too many instances when Excel is wrong to go that route.
Thanks,
Jerry

[email protected]

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Fri Apr 01, 2011 6:38 pm

There are even too many instances when Excel is wrong to go that route.
WHAT ????????


My suggestions don't involve Excel. You merely need to "escape" the string before you send it to a web service.

Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Post by Jerry Thomas » Fri Apr 01, 2011 7:05 pm

I can get the equation into the field with no problem. It's pressing the = button to compute the answer that is the problem.

I thought you were offereing alternatives to using a web service and I was just mentioning that we need a very degree of correctness.
Thanks,
Jerry

[email protected]

Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Post by Jerry Thomas » Fri Apr 01, 2011 7:41 pm

I missed the change that Marcus had made in the 2nd post.
Changing 0 to submit.

That does work.

Many thanks and apologies for the confusion.
Thanks,
Jerry

[email protected]

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Fri Apr 01, 2011 7:56 pm

This also works for me and is very simple.

Code: Select all

VBSTART
VBEND

Input>result,Enter a calculation

VBEval>Escape("%result%"),result
StringReplace>result,+,%2B,result

Let>URL=http://www.wolframalpha.com/input/?i=%result%
ExecuteFile>URL

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts