// This script prompts for the name of the company and downloads // the most recent FORM 10-Q (Quarterly and Transition Reports // Under Section 13 or 15(d) of the Securities Exchange Act) program SECFiling; const sPath = 'c:\Temp\'; var CompanyStr : string; bFound : boolean; procedure OnDocumentComplete(URL : string); begin if IsPartOf('http://www.sec.gov/edgar/searchedgar/companysearch.html', URL) then begin Fill('company', CompanyStr); ClickButton(''); end; if IsPartOf('http://www.sec.gov/cgi-bin/browse-edgar?company=', URL) then begin ClickHyperLink('10-Q'); end; if IsPartOf('http://www.sec.gov/Archives/edgar/data/', URL) and not(bFound) then begin bFound := ClickPartialHyperLink('Document 1 - file:'); end else if (bFound) then begin GetURLFile(sPath+CompanyStr, URL); bFound := False; end; end; begin CompanyStr := Readln('Enter Company Name:'); Navigate('http://www.sec.gov/edgar/searchedgar/companysearch.html') end.