Hello ,everybody
I use this browser named Mozilla Firefox to open this web page
http://www.tianyancha.com/company/398459114
,and I can see web
page information.
When use Httpfox to open this website http://www.tianyancha.com/company/398459114.json
,can see information too.
I want to obtain the web page information,I write these code as follow :
but shows {"state":"error","message":"","data":null}.
please tell me how to get to this web page information, thank you ~
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;
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 ~