BS4: AttributeError: 'NoneType' object stops the parser from working

I'm currently working on a parser to make a small preview of a page from a URL given by the user in PHP. I'd like to retrieve only the title of the page and a little chunk of information (a bit of...