Python Forum

Full Version: What is the capacity of console to display print conent?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to print the source content of a website (by using urlopen the object and then print the object's read()).

Initially what it printed in console does not match with what I have seen from the original source content of the website.
Then I realize the print() does print but the console cutoff the first part of the content.
I guess it may be because the content is too much to display in console.
By object.print(100), I am able to see the top part of the content.

So, what is console's capacity to display? Is there a way to force it print all? Maybe this is a risky idea because certainly sometimes the content is too huge to display....
You can edit your terminal preferences to utilize more lines. You could alternatively port it through less to scroll up or down through. However with HTML, it can get mashed together so you can use BeautifulSoup's prettify to organize the HTML into a nested data structure.
If there is any not closed tags or something similar BeautifulSoup will try to fix the html code. The web browsers are tolerant to a broken HTML. So you may get not exactly the original code but I don't see a problem with this. However, if you get a strange result, try to change the parser