You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this is not good idea - because this decode all entities from HTML (for example i have bigger document where can by for example used > or ).
Activity
shtse8 commentedon Feb 27, 2017
I have tried DomCrawler, but it is fine without any problem when encoding Utf-8.
Code:
Result:
And I find they have fixed this bug already.
https://github.com/symfony/dom-crawler/pull/4
shtse8 commentedon Feb 27, 2017
I am trying to fix this problem. #19
kukungkung commentedon Oct 21, 2017
I think it can help you
curl_setopt($ch, CURLOPT_ENCODING, 'UTF-8');
yellow1912 commentedon Feb 20, 2019
Any update on this issue, do we still have problem with UTF-8 because this is a huge problem if it does exist, most sites use UTF-8 anyhow.
havran commentedon Mar 4, 2019
Same problem here, in v1.3.
glensc commentedon Mar 4, 2019
I just decode entities after the save:
glensc commentedon Mar 4, 2019
seems the underlying problem is that symfony/dom-crawler switches to entities to avoid some other bugs:
havran commentedon Mar 4, 2019
I think this is not good idea - because this decode all entities from HTML (for example i have bigger document where can by for example used > or ).
I found solution which work for me - in line:
htmlpagedom/src/HtmlPageCrawler.php
Line 887 in 563bc7a
to:
based by https://stackoverflow.com/a/20675396
havran commentedon Mar 4, 2019
But my solution for some reason remove DOCTYPE in this test script:
This is output:
glensc commentedon Mar 4, 2019
html_entity_decodeis perfectly valid, if you wanted to have putput as&then it should be in source document as&.havran commentedon Mar 9, 2019
I make small test script for compare various DOM parsers - https://github.com/havran/php-html-parsers-test
Old simplehtmldom seems still best :-).