Internet related perl script


/ Published in: Perl
Save to your folder(s)



Copy this code and paste it in your HTML
  1. //simple http request
  2. use LWP::Simple;
  3. use LWP::UserAgent;
  4.  
  5. sub httpreq {
  6. my($srcpath, $destpath) = @_;
  7.  
  8. my $user_agent = LWP::UserAgent->new;
  9. my $request = HTTP::Request->new('GET', $srcpath);
  10. my $response = $user_agent->request ($request, $destpath);
  11.  
  12. }
  13.  
  14. //IE automation
  15. use Win32::IEAutomation;
  16. my $ie = Win32::IEAutomation->new( visible => 1, maximize => 1);
  17. $ie->gotoURL('http://www.bega.de/index.php?sprache=en');
  18.  
  19. //HTML builder
  20. //used for parse html contents into tree structured array for easy searching
  21. my $right = $ie->getFrame('name:',"pib");
  22. my $root = HTML::TreeBuilder->new_from_content($right->Content());

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.