Navigate to tabs chrome-php

61 views Asked by At

Clicking in a link Using [chrome-php][1] the page opens a new tab.

How can I make the new tab active? I can see that the new page is open when I get the Target information, but somehow when i get the page HTML it shows the HTML for the initial page.

    $browser = $this->getBrowser();
    $targets = $browser->getTargets();

    if(sizeof($targets) > 1){

        foreach($targets as $target){
            $targetTitle = $target->getTargetInfo('title');
            $targetId = $target->getTargetInfo('targetId');

            if($targetTitle == 'my title'){
                $page = $browser->getPage($targetId);
            }
        }
    }

  [1]: https://github.com/chrome-php/chrome/tree/1.9#chrome-php
0

There are 0 answers