Closed Baltazar500 closed 2 years ago
It is turning the file into:
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<center>
<table border="1" cellpadding="5">
<tbody><tr>
<td>123</td>
</tr>
<tr>
<td>456</td>
</tr>
</tbody></table>
</center>
</body></html>
So you need xidel -se '/html/body/center/table/tbody/tr/td' './test.html'
That is how it is supposed to be in HTML5. Although Xidel does not have a HTML5 parser. Looks like I started implementing parts of HTML5 and then forgot about them...
With all this, when using the pipe and processing stdout of the same file, everything works
cat ./test.html|xidel -se '/html/body/center/table/tr/td' 123 456
What is the problem ?
And the difference is the file name. If it sees the file name test.html
, it uses the HTML parser. In the pipe, there is no file name, so when it sees <?xml
, it uses the XML parser.
If you rename it to test.xml, it will also use the XML parser
It is the same in Firefox:
If you rename it to test.xml, it will also use the XML parser
Yes, it works. And it worked too
xidel --input-format=xml -se '/html/body/center/table/tr/td' './test.html' 123 456
Any changes expected ? Should I close this issue or will you close it ?
Hi.
I am getting empty output when using the full xpath for a html file.
Expression :
Example :
With all this, when using the pipe and processing stdout of the same file, everything works
What is the problem ?