| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package WWW::Crawl4AI::Strategy::Stealth; |
|
2
|
|
|
|
|
|
|
# ABSTRACT: Crawl4AI strategy with enable_stealth and randomized fingerprint |
|
3
|
2
|
|
|
2
|
|
9
|
use Moo; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
9
|
|
|
4
|
2
|
|
|
2
|
|
671
|
use WWW::Crawl4AI::Request (); |
|
|
2
|
|
|
|
|
10
|
|
|
|
2
|
|
|
|
|
233
|
|
|
5
|
|
|
|
|
|
|
with 'WWW::Crawl4AI::Strategy'; |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.001'; |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
25
|
|
|
25
|
1
|
66
|
sub name { 'crawl4ai_stealth' } |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
6
|
|
|
6
|
1
|
42
|
sub cost_class { 'stealth' } |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub build_request { |
|
17
|
6
|
|
|
6
|
0
|
12
|
my ( $self, $crawler, $url ) = @_; |
|
18
|
6
|
|
|
|
|
16
|
return $self->_request( |
|
19
|
|
|
|
|
|
|
$url, |
|
20
|
|
|
|
|
|
|
browser => { |
|
21
|
|
|
|
|
|
|
enable_stealth => WWW::Crawl4AI::Request::JSON_true(), |
|
22
|
|
|
|
|
|
|
user_agent_mode => 'random', |
|
23
|
|
|
|
|
|
|
}, |
|
24
|
|
|
|
|
|
|
crawler => { wait_until => 'networkidle' }, |
|
25
|
|
|
|
|
|
|
); |
|
26
|
|
|
|
|
|
|
} |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__END__ |