Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect behaviour on parsing html #41

Closed
behzadsh opened this issue Nov 19, 2015 · 1 comment
Closed

Incorrect behaviour on parsing html #41

behzadsh opened this issue Nov 19, 2015 · 1 comment

Comments

@behzadsh
Copy link

I was trying to pars html content of cnn.com news pages, and when I get body tag, using both find() and getElementByTag() half the content was gone. I put parsed content into a file, and realized some tags like <article> are out of <body> or <html> tag, something like this:

<html>
  <head>...</head>
  <body>...</body>
  <article>...</article>
  <div>...</div>
</html>
<div>...</div>

php code:

<?php

$dom = new PHPHtmlParser\Dom();
$url = 'http://edition.cnn.com/2015/11/19/tennis/world-tour-finals-federer-nishikori/index.html';
$dom->load($url);
file_put_contents('test.html', (string) $dom);
@paquettg
Copy link
Owner

I am not able to duplicate your issue, please reopen if you are stil experience your issue with more details and I will continue to look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants