Delays in Parsing in PHP
To simulate user behavior, it is necessary to set delays between requests to a foreign site.
Delays are set using the PHP
function sleep, which accepts
time in seconds as a parameter - for this time
the script simply "sleeps", and then its execution
resumes:
<?php
sleep(3); // sleep for 3 sec
?>
Set uneven delays, otherwise
a script sending requests with a frequency of,
for example, exactly 5 seconds,
is easily tracked and banned.
The delay time for each site should
be selected individually.
Make a parser that will pause for 10 seconds between requests.
Make a parser that will pause between requests. The number of seconds for the pause should be a random number from 5 to 20 seconds.