| 1 | package WWW::Crawl4AI::Strategy::Stealth; | ||
| 2 | # ABSTRACT: Crawl4AI strategy with enable_stealth and randomized fingerprint | ||
| 3 | 5 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 5 | ▶ | use WWW::Crawl4AI::Request (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 5 | with 'WWW::Crawl4AI::Strategy'; | |
| 6 | |||
| 7 | 5 | our $VERSION = '0.001'; | |
| 8 | |||
| 9 | |||
| 10 | 25 | ▶ | sub name { 'crawl4ai_stealth' } |
|
Subroutine
name: called CC=1 SCAR=0.0
Pod
documented
| |||
| 11 | |||
| 12 | |||
| 13 | 6 | ▶ | sub cost_class { 'stealth' } |
|
Subroutine
cost_class: called CC=1 SCAR=0.0
Pod
documented
| |||
| 14 | |||
| 15 | |||
| 16 | 6 | ▶ | sub build_request { |
|
Subroutine
build_request: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 17 | 6 | my ( $self, $crawler, $url ) = @_; | |
| 18 | 6 | 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 | 5 | 1; | |
| 29 | |||
| 30 | __END__ | ||