I wanted to search for a specific br tag(the last br tags in each div like text3,text6,text9) in a div :
<li class="odd"> text1 <br> text2 <br> text3 <br> text4</li>
<li class="odd"> text4 <br> text5 <br> text6 </li>
...
<li class="odd"> text7 <br> text8 <br> text9 <br> text10</li>
and this the code i used:
from bs4 import BeautifulSoup
import requests
URL = '...'
content = requests.get(URL)
soup = BeautifulSoup(content.text, 'lxml')
contentTable = soup.find_all("li", {"class": "odd"})
for li in contentTable:
print(li.text)
and the output is this:
text1 text2 text3 text4 ...text9
now my problem is that I don't know how to only extract and find the br tags that I want.