Large strings not shown properly
See original GitHub issueWhen I’m looking for the src-Attribute of an image wich has a base64 string I would get back a very long string (up to 100 KB) but instead cheerio returns a shortened version to me, wich looks something like this:
data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
I think thats intentional wich I can understand to prevent damage but I’m aware that I’ll get back a very large string. How can I get the unshortened version?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Not able to print very large strings in java (neither in Eclipse ...
One thing thats pissed me off at least twice, sometimes Eclipse won't show a large string properly in the console, it's blank.
Read more >Strings - C# Programming Guide | Microsoft Learn
A string is an object of type String whose value is text. Internally, the text is stored as a sequential read-only collection of...
Read more >Strings - Manual - PHP
A string is series of characters, where a character is the same as a byte. This means that PHP only supports a 256-character...
Read more >JavaScript Strings - W3Schools
JavaScript strings are for storing and manipulating text. A JavaScript string is zero or more characters written inside quotes.
Read more >37 - Working With Large Strings - Genero software ... - 4Js
In the last Ask Reuben article I looked at using STRING over using CHAR and one of the reasons is performance, particular with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Call it boredom, but I tried make what I suggested earlier.
I loaded some source from google and I discovered it is probably not cheerios fault. dump.html
Google uses little trick there - when page is loaded from their site, image tags are filled with those place holders (seen above). Later when browser has finished rendering the page, browser uses javascript to replace those place holders with real images. It actually helps render pages quicker.
It may be confusing when you look source in browser you see big pictures but it is because browser has already replaced images. Sadly Cheerio can only read values what are in image tags during load.
Interestingly image data is loaded with page, but data is stored in script tags, like so:
you could actually find those script tags and extract data from those.