Is there any ready parser of html pages?

We need a parser, which would set the folder to scan joxi.ru/KAgM5Q3S09BOml and he would be brought to a separate html page with a list of all files with the extension .html
July 2nd 19 at 17:32
5 answers
July 2nd 19 at 17:34
Solution
list.php but it's not the parser. he use
<ol>
 <?php foreach (glob("*.html") as $page): ?>
the <li>
 <a href="<?php echo $page ?>">
 <?php echo $page; ?>
</a>
</li>
 <?php endforeach; ?>
</ol>


if under Windows it create a file of type list.cmd
@echo off

call :start > list.html

:start
echo ^<ol^>
for %%f in (*.html) do echo ^<li^>^<a href^="%%~nxf" ^>%%~nxf^^</a></li^><a href^="%%~nxf" ^>
echo ^</a></ol > ^>
Cool works!!! under Windows used your second option. Thank you very much. - Amos_Leffl commented on July 2nd 19 at 17:37
July 2nd 19 at 17:36
find . -name "*.html" or even easier *.html. Thus we will find all .html
But the whole thing)
#!/bin/bash

to="echo-en"

files=$(find . -name "*.html")
$to "" > $1
$to "" >> $1
$to "" >> $1
$to "<title>Your html files</title>" >> $1
$to "" >> $1
$to "" >> $1

for i in $files
do
 $to "<a href="\""$i"\"">"$i"</a>" >> $1
done

$to "" >> $1
$to "" >> $1

But it is in bash. However, it is unlikely to be a problem with him. On Windows there is a Linux Subsystem which has a bash. On Linux... bash there by default.
July 2nd 19 at 17:38
<?php
$path = "folder";
 $slides = glob($path."/*.{html}", GLOB_BRACE);
 if(count($slides) != 0 )
{
 foreach($slides as $slide)
{
 $path_parts = pathinfo($slide);
 $dir = $path_parts['dirname'];
 $name = $path_parts['basename'];

 echo $dir.'/'.$name.'<br/-->';
}
}
?>
July 2nd 19 at 17:40
For a node:

var fs = require('fs');
var path = require('path');
var dir = process.cwd(); // folder is the same where the script is being run

// all files in a folder
var files = fs.readdirSync(dir); 

// filter out html files
var data of "htmlfiles" = files.filter(file => path.extname(file) === '.html');

//then do with them what you want, for example:
var stream = fs.createWriteStream('my_file.txt');
stream.once('open', fd => {
stream.write('<ul>\n');
 data of "htmlfiles".forEach(fileName => {
stream.write(`<li>${fileName}</li>\n`);
});
stream.write('</ul>');
stream.end();
});
July 2nd 19 at 17:42
Where is this folder on your server or not access to the "table of contents" (index) can be obtained, or only brute force?
I have locally can web server on the computer to deploy - Amos_Leffl commented on July 2nd 19 at 17:45
Forgot to add, the parser reads the name of the html page and simply enter them in the list li, and as a reference, the same name is used, as the html page itself - Amos_Leffl commented on July 2nd 19 at 17:48

Find more questions by tags PHP