Python Forum
What is the capacity of console to display print conent?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is the capacity of console to display print conent?
#1
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....
Reply
#2
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.
Recommended Tutorials:
Reply
#3
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
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020