Просто начинайте работу с Web Scraping с BeautifulSoup и Requests.Я пытаюсь создать скрипт, который мог бы обрабатывать сообщения в упорядоченном списке здесь
Я застрял на том, как напечатать строку 2 из перечисленных сообщений там
Это сценарий, который у меня есть.
from bs4 import BeautifulSoup
import requests
res = requests.get("https://www.serenataflowers.com/pollennation/love-text-messages/")
soup = BeautifulSoup(res.text, 'html.parser')
ol = soup.find('ol')
print(ol.prettify())
Скрипт распечатывает только весь текст.Как мне распечатать текст 2 или текст 3 и так далее ...
Заранее спасибо.
Редактировать: Это результат, который я получаю при запуске скрипта.
C: \ Users \ XXXX \ MyPythonScripts> scrape.py
<ol class="simple-list">
<li>
Meeting you was the best day of my life.
</li>
<li>
When you are next to me, or when we are apart, You are always the first in my thoughts and in my heart.
</li>
<li>
I never ever thought I’d like you this much and I never planned to have you on my mind this often.
</li>
<li>
I love the way you love me.
</li>
<li>
Spring drops and the sun outside the window tell me that this spring will be the flowering of our love.
</li>
<li>
I can’t spend a day without you, can’t you see? I love you so much. You are a part of me and this is forever.
</li>
<li>
You make me happy in a thousand ways. I love you to the moon and back, and I have no idea what I would do, if I lost you, because I feel like I will lose my entire world.
</li>
<li>
Nothing is going change my love for you, you are the man, who helped me to find myself in this life.
</li>
<li>
I can’t imagine living a life without you. You are my reason to be.
</li>
<li>
The wind whispers your name, stars illuminate my way to you, we will meet soon, love you!
</li>
Я был на самом делеищу распечатать следующий контент (ы) по тегу <li>
.