no query item shows in scripts

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
bbgaw
Newbie
Posts: 13
Joined: Thu May 08, 2008 7:54 pm

no query item shows in scripts

Post by bbgaw » Tue May 13, 2008 7:30 pm

Hi,

I am trying to automate this website. I recorded it through WebRecorder, but it seems like my query item is not shown in the scripts at all. Then how can I tell script what to search? Is it hidden somewhere? I did input 71-43-2 in the search box.

Here is my scripts. Thanks a lot!

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

IE_Navigate>%IE[0]%,http://ecb.jrc.it/esis/,r
IE_Wait>%IE[0]%,r
Wait>delay

Let>FrameName={"esisquestion"}
Let>FormName={"ESISISForm"}
Let>TagValue={""}
IE_ClickTag>%IE[0]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue,r

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

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

Post by Marcus Tettmar » Wed May 14, 2008 2:29 pm

Not sure why that fails to record, but this works fine:

Code: Select all

// Generated by MacroScript WebRecorder 2.03
// Recorded on  Wednesday, May 14, 2008, at 03:25 PM
LibLoad>IEAuto.dll,hIE
If>hIE=0
  MessageModal>Could not load IEAuto.dll, make sure it is in the path or edit the LibLoad line.
  Goto>end_script
EndIf

//Move the mouse cursor out of harm's way to avoid causing mouseover events to interrupt
MouseMove>0,0
Let>delay=1

LibFunc>hIE,CreateIE,IE[1],0

LibFunc>hIE,Navigate,r,%IE[1]%,http://ecb.jrc.it/esis-pgm/esis_pgm.php
LibFunc>hIE,WaitIE,r,%IE[1]%
Wait>delay

LibFunc>hIE,WaitIE,r,%IE[1]%
Wait>delay

Let>FrameName={"esisquestion"}
Let>FormName={"ESISISForm"}
Let>FieldName={"ENTREE"}
Let>FieldValue={"71-43-2"}
LibFunc>hIE,FormFill,r,%IE[1]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0

Let>FrameName={"esisquestion"}
Let>FormName={"ESISISForm"}
Let>TagValue={""}
LibFunc>hIE,ClickTag,r,%IE[1]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue

LibFunc>hIE,WaitIE,r,%IE[1]%
Wait>delay

LibFree>hIE
Label>end_script
That was recording against the required frame.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

bbgaw
Newbie
Posts: 13
Joined: Thu May 08, 2008 7:54 pm

more questions

Post by bbgaw » Wed May 14, 2008 9:57 pm

Hi, Marcus!

That works! I am able to search now. Then I got the following questions about "parse" the webpage I got, so that I can save the right file.

My question is When I search by CAS# 121-32-4, then on the result page, I got a line saying:
" IUCLID & OECD Chemical Data Sheets and Export Files Information:

Not available for this substance. "

in this case, I don't save anything. I wonder how can I determine this case happened. Can I still use IE_ContainsText> since I got two lines now?

My second question is: when I search by CAS# 71-43-2, I got a line saying:
" IUCLID & OECD Chemical Data Sheets and Export Files information:

IUCLIC Chemical Data Sheet: view & save it

How Can I tell the scripts that I want to click view & save it on this line, since there several of them at different places on this page?

Thank you very much!

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

Post by Marcus Tettmar » Mon May 19, 2008 9:12 am

Yes, you can use ContainsText and check for "Not available for this substance".

To click on multiple links with the same text you would have to specify the tag using some other attribute. With luck each anchor has a different name/ID. If not, you can specify INDEX and refer to each one by number. See the WebRecorder help file.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

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