Grabbing text from a webpage

前端 未结 8 487
南旧
南旧 2021-01-03 09:54

I would like to write a program that will find bus stop times and update my personal webpage accordingly.

If I were to do this manually I would

  1. Visit
8条回答
  •  温柔的废话
    2021-01-03 10:37

    You can use Perl to help you complete your task.

    use strict;
    use LWP;
    
    my $browser = LWP::UserAgent->new;
    
    my $responce = $browser->get("http://google.com");
    print $responce->content;
    

    Your responce object can tell you if it suceeded as well as returning the content of the page.You can also use this same library to post to a page.

    Here is some documentation. http://metacpan.org/pod/LWP::UserAgent

提交回复
热议问题