program BookSearch; // Fill out Newbie Form and simultaneously search // for books in Amazon, Ebay and Alibris websites // Make sure Navigate() contains the correct path // select "Launch in IE" when running this script var bStop : boolean; sKeyword: string; { Process events here } procedure OnDocumentComplete(URL : string); begin if IsPartOf('http://www.alibris.com', URL) then begin // extract keyword from Newbie Form sKeyword := ExtractURLParam('BookName'); Fill('wtit', sKeyword); ClickImageButton('Go'); OpenInternetExplorer('http://www.amazon.com'); end; if IsPartOf('http://www.amazon.com', URL) then begin SelectListIndex('url', 1); // books Fill('field-keywords', sKeyword); ClickButton('Go'); OpenInternetExplorer('http://books.ebay.com'); end; if IsPartOf('http://books.ebay.com', URL) and not(bStop) then begin Fill('query', sKeyword); ClickButtonValue('Search'); // use bStop to prevent looping bStop := True; end; end; { This is the main program body. } begin bStop := False; Navigate('C:\Program Files\Newbie\Forms\BookSearch.htm'); end.