Perl_Love has asked for the wisdom of the Perl Monks concerning the following question:
Hello! Thank you for soon reply ! Is there any better method of using Perl to get this web page or get JSON information ? Must though http://antirobot.tianyancha.com/captcha/verify first ? By the way ,if when access, download the authentication code, and then manually enter position, and then submit the manual input position through similar LWP module, access to web pages or JSON information? Whether this method can be ok ? Kindly give me the suggestion ,thanks a lot ~use HTTP::Cookies; use LWP::UserAgent; use HTTP::Request::Common qw (GET POST); $|=1; my $ua=LWP::UserAgent->new(agent=>'Mozilla/5.0 (Windows NT 10.0; rv:46 +.0) Gecko/20100101 Firefox/46.0',timeout=>10); my $cookie_jar=HTTP::Cookies->new(); $ua->cookie_jar($cookie_jar); my %h=( 'Tyc-From'=>'normal', 'Accept-Encoding'=>'gzip, deflate', 'Accept'=>'application/json, text/plain, */*', 'Referer'=>'http://www.tianyancha.com/company/398459114' ); my $ba=$ua->request(GET 'http://www.tianyancha.com/company/398459114.j +son',%h)->as_string; open(C,">test_get.txt") or die; print C "$ba"; close C;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unable to get the JSON data in the website
by tangent (Parson) on May 10, 2016 at 16:55 UTC | |
|
Re: Unable to get the JSON data in the website
by talexb (Chancellor) on May 10, 2016 at 16:22 UTC |