Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you have the raw HTML of the page you want to parse you can use a preg_match to find it.</p> <p>If you don't have the HTML this should help you: <a href="https://stackoverflow.com/questions/819182/how-do-i-get-the-html-code-of-a-web-page-in-php">How do I get the HTML code of a web page in PHP?</a></p> <p><a href="http://php.net/manual/es/function.preg-match.php" rel="nofollow noreferrer">preg_match()</a></p> <p>This function lets you parse a string with a regular expression pattern. It would be recommended to get only a fraction of the HTML to parse, not all the page. For example, in this case I would try to get the HTML of the first table (the one that doesn't have info of the previous episode).</p> <pre><code>$subject="the HTML of the url you want to parse"; $pattern='/Number:&lt;\/td&gt;&lt;td.+?&gt;(\d+)&lt;\//'; if(preg_match($pattern, $subject, $hits)){ echo "Number: $hits[0]"; } </code></pre> <p>In case you don't know how a regular expression works: </p> <p>'.' is a reserved character that means 'any character', the '+' right after it means 'one or more than one' and the '?' makes the regular expression non-greedy. So if we sum it up '.+?' means 'one or more of any character, but make it as short as possible'.</p> <p>'(' and ')' indicates we want to retrieve what is between them, and '\d' means a number. So '(\d+)' means 'put that combination of numbers in the $hits array'.</p> <p>If you use the same regular expression but with preg_match_all you would retrieve all the numbers of the web that follow that same pattern, they would be inside the $hits array.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload