php调用谷歌无头浏览器访问网页+推送百度(代码备份)

php调用谷歌无头浏览器访问网页(代码备份):

<?php
$i = 1403;
while ($i--) {
    $url = "https://wap.xingxinghan.cn/?id=" . $i;
    $cmd = "chrome --headless --disable-gpu  $url";
    echo $url . PHP_EOL;
    exec($cmd);
    sleep(10);
    push($url);
}

function push($url)
{
    $urls = array(
        $url,
    );
    $api = 'http://data.zz.baidu.com/urls?site=https://wap.xingxinghan.cn&token=JFlzEXUDAXAZDvXyZl2';
    $ch = curl_init();
    $options = array(
        CURLOPT_URL => $api,
        CURLOPT_POST => true,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_POSTFIELDS => implode("\n", $urls),
        CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
    );
    curl_setopt_array($ch, $options);
    $result = curl_exec($ch);
    echo $result . PHP_EOL;
}


<?php
while(true)
{
    $response = file_get_contents('http://learn.gaojiufeng.cn/index/test1x/showId');
    $response = json_decode($response);
    foreach ($response as $key => $value) {
        $url = "https://www.gaojiufeng.cn/?id=" . $value;
        $cmd = "chrome --headless --disable-gpu --window-size=1920x1080  $url";
        echo $url . PHP_EOL;
        echo $cmd . PHP_EOL;
        exec($cmd);
        sleep(15);
    }
}

目的:刷真实PV增加收录

访客
邮箱
网址


  •  learn
  • 分辨率设置--window-size=1920x1080发布于 2021-05-11 18:18:54   回复ta
通用的占位符缩略图

人工智能机器人,扫码免费帮你完成工作


  • 自动写文案
  • 自动写小说
  • 马上扫码让Ai帮你完成工作
通用的占位符缩略图

人工智能机器人,扫码免费帮你完成工作

  • 自动写论文
  • 自动写软件
  • 我不是人,但是我比人更聪明,我是强大的Ai
Top