Comments (6)
Could you give me the content or url your were using to reproduce the bug?
from php-readability.
from php-readability.
Thanks I'll take a closer look.
from php-readability.
I think the problem at the code between 530 and 560 lines : $iframe->item(0)->nodeValue = ' '
from php-readability.
Could you give me a snippet how to reproduce the bug?
I've tried with that:
<?php
require 'vendor/autoload.php';
$url = 'http://iosgames.ru/?p=22030';
$data = file_get_contents($url);
$readability = new \Readability\Readability($data, $url);
$result = $readability->init();
var_dump($result, $readability); die();
And I didn't get any errors.
Which version of PHP are you using? Did you have the tidy extension installed?
from php-readability.
PHP 5.3.10-1ubuntu3.19
Tidy support => enabled
libTidy Release => 25 March 2009
Extension Version => 2.0
Try that:
function error2Exception($code, $string, $file, $line, $context)
{
throw new Exception($string, $code);
}
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', true);
set_error_handler('error2Exception', E_ALL | E_STRICT);
require 'vendor/autoload.php';
$url = 'http://iosgames.ru/?p=22030';
$data = file_get_contents($url);
$readability = new \Readability\Readability($data, $url);
$result = $readability->init();
var_dump($result, $readability); die();
Exception from my script:
PHP Fatal error: Uncaught exception 'Exception' with message 'DOMDocumentFragment::appendXML(): Entity: line 3: parser error : Entity 'nbsp' not defined' in test.php:14
Stack trace:
#0 [internal function]: error2Exception(2, 'DOMDocumentFrag...', '/home/www/libs/...', 57, Array)
#1 /home/www/libs/php-readability/src/JSLikeHTMLElement.php(57): DOMDocumentFragment->appendXML('<div class="ent...')
#2 /home/www/libs/php-readability/src/Readability.php(559): Readability\JSLikeHTMLElement->__set('innerHTML', '<div class="ent...')
#3 /home/www/libs/php-readability/src/Readability.php(911): Readability\Readability->prepArticle(Object(Readability\JSLikeHTMLElement))
#4 /home/www/libs/php-readability/src/Readability.php(291): Readability\Readability->grabArticle()
#5 test.php(27): Readability\Readability->init()
#6 {main}
thrown in test.php on line 14
from php-readability.
Related Issues (20)
- outlined words get censored on psychologytoday.com HOT 2
- Preserve newlines? HOT 2
- A lot of warnings (with russian language ?)
- More warnings HOT 4
- Keep URLS into documents HOT 9
- Error during cleanup HOT 3
- not working in cronjob HOT 8
- Error: A non well formed numeric value encountered HOT 11
- Consider ignoring empty node contents
- Composer printing warning with php-html5lib HOT 1
- Unable to attach logger for loadHTML HOT 2
- Unexpected title cleaning HOT 2
- Not able to get the full content HOT 3
- Can't install with Laravel 9 HOT 2
- Issue with one URL and his content HOT 2
- Readability 3.0 HOT 2
- Problem with article extraction HOT 4
- how can i get Excerpt, image and Author? HOT 4
- Call to undefined method DOMDocument::hasAttribute() HOT 2
- Readability removes headings when they have a link in them
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-readability.