The owners of this page have gone to some effort to ensure people are not screen scraping their page using a robot. This involves lots of javascript. Interestingly they have the equivalent of fatalsToBrowser enabled.
Here is one way to get the data by automating IE. This is only presented for interest and is a fragile solution. Use of such code may breach the cboe.com TOS/TOC. Usual suggestion is not to be a cheapskate and buy the data you want.
use Win32::IE::Mechanize; use Win32::GuiTest qw(FindWindowLike SetForegroundWindow SendKeys); my $ticker = 'INTC'; my $time = time(); my $filename = "$ticker-$time.txt"; my $ie = Win32::IE::Mechanize->new( visible => 1 ); $ie->get( "http://www.cboe.com/DelayedQuote/QuoteTableDownload.aspx" ) +; if ( fork ) { $ie->form_name( "QuoteTableDownload" ); $ie->set_fields( ticker => $ticker ), $ie->click_button( value =>'Download' ); print "Closing IE\n"; $ie->close; } else { my $window; sleep 1 until ($window) = FindWindowLike(0, "^File Download" ); print "Got $window\n"; SetForegroundWindow($window); SendKeys("{TAB}~"); sleep 1; SendKeys("$filename~"); }
cheers
tachyon
In reply to Re: save file from POST form??
by tachyon
in thread save file from POST form??
by cwchang
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |