Писал под хуман проверку, но с яндексом такие номера у меня не проходят. Лучше проверять размером файлов. Выкладываю тут бесполезную пока для меня функцию.
function find_cms($link,$api,$capch_save){
global $browser, $input,$button,$webpage,$image;
$browser->set_active_browser(1,true);
$arr=array(
'k2' => array('inurl:"index.php?option=com_k2&view=itemlist&task=user" site:') ,
'IPB' => array('inurl:"index.php?showforum=" site:'),
'PHPBB' => array('inurl:"phpBB3/viewtopic.php" site:' ,
'inurl:"phpBB2/viewtopic.php" site:' ,
'inurl:"phpBB/viewtopic.php" site:') ,
'vBulletin' => array('inurl:"blog.php?b=" site:' ,
'inurl:"automodule=blog" site:')
);
foreach ($arr as $k => $fff){
foreach ($fff as $v){
$str=str_replace('http://',$v,$link);
$browser->navigate("http://ya.ru");
$browser->wait_for();
$input->click_by_name("text");
sleep (2);
$input->set_inner_text_by_name("text",$str);
sleep(2);
$browser->wait_for();
$button->click_by_number(0);
$browser->wait_for();
sleep (2);
$text=$webpage->get_body();
if (preg_match('/captchaimg/si',$text)){
while (preg_match('/captchaimg/si',$text)){
preg_match('/http:\/\/yandex\.ru\/captchaimg.*?(\")/si',$text,$preg);
$url=str_replace('"','',$preg[0]);unset($preg);
$browser->set_count(3);
$browser->wait_for();
$browser->set_active_browser(2,true);
$browser->wait_for();
$browser->navigate($url);
$browser->wait_for();
sleep (2);
$image->screenshot_by_number($capch_save,0);
$browser->set_active_browser(1,true);
$browser->wait_for();
$browser->set_count(2);
$browser->wait_for();
$str_captcha=$image->recognize_by_anticaptcha('',$capch_save,$api,$path='http://antigate.com',$is_verbose = false, $rtimeout = 5, $mtimeout = 1200, $is_phrase = 0, $is_regsense = 0, $is_numeric = 0, $min_len = 0, $max_len = 0, $is_russian=1);
$input->send_keyboard_input_by_name("rep",$str_captcha);
$button->click_by_number(0);
$browser->wait_for();
sleep (3);
$text=$webpage->get_body();
$browser->wait_for();
}}
if ((preg_match('/По вашему запросу ничего не нашлось/si',$text))==false){
$fp = fopen("ready/$k.txt", "a+");
fwrite($fp, "$link\r\n");
fclose($fp);
$fp = fopen("ready/all.txt", "a+");
fwrite($fp, "$link\r\n");
fclose($fp);
}
}}
$browser->set_active_browser(0,true);
}
|