开发者

How can I get headers of the URL from chrome-php

开发者 https://www.devze.com 2022-12-07 18:11 出处:网络
I am using chrome-php I want to get the header from the response Is there any way I can get it? Here is how I am trying to implement the functionality ...

I am using chrome-php I want to get the header from the response Is there any way I can get it? Here is how I am trying to implement the functionality ...

$browserFactory = new BrowserFactory('chromium-browser');

// starts headless chrome
$browser = $browserFactory->createBrowser([
    'noSandbox' => true,
    'debugLogger' => 'php:/开发者_JAVA技巧/stdout',
]);

try {
            
    $page = $browser->createPage();
    $page->navigate($url)->waitForNavigation();

    info([$page->getHtml()]);

finally {
    $browser->close();
}
0

精彩评论

暂无评论...
验证码 换一张
取 消