BeautifulSoup: working with HTML

Title parsing

Report a typo

There is a code that searches and prints all titles from the webpage, but the code is in the wrong order. Arrange it in the correct way and add indents where necessary. Use the arrows on the right to move the lines up and down and the arrows on the left to add indentation (one click equals one indentation: four spaces).

To pass the test, please, import the module requests first. Also, create the soup object only after you've sent the request.
Reorder lines using drag or arrows. Adjust indentation with left buttons
                print(i.text + '\n')
              
                r = requests.get('https://www.newsinlevels.com')
              
                soup = BeautifulSoup(r.content, 'html.parser')
              
                import requests
              
                for i in titles:
              
                titles = soup.find_all('title')
              
                from bs4 import BeautifulSoup
              
___

Create a free account to access the full topic