Jan-28-2018, 08:57 AM
The returned by get() method object is a class with methods and attributes.
This is why you have to use .text or .content attribute to get the source of the page.
One line:
This is why you have to use .text or .content attribute to get the source of the page.
One line:
page = requests.get('http://python-forum.io').contentThe .content is the response in bytes while the .text is in Unicode. The other methods and attributes you see when you dir() the response object have quite descriptive names so you get the picture.