PHP code example of theseer / css2xpath

1. Go to this page and download the library: Download theseer/css2xpath library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

theseer / css2xpath example snippets



$translator = new TheSeer\CSS2XPath\Translator();

// Will output //*[contains(concat(" ",normalize-space(@class)," ")," note ")]
echo $translator->translate('.note');

// Will output //*[@id="me"]
echo $translator->translate('#me');