I have written following code
page=requests.get("http://3.85.131.173:8000/random_company")
soup=BeautifulSoup(page.content,"html.parser")
info_list=soup.find_all("li")
print(info_list)
and print gives following answer
[<li>Name: Walker, Meyer and Allen</li>, <li>CEO: David Pollard</li>, <li>CTO: Sandra Boyd</li>, <li>Address: 275 Jones Station Suite 008
Bradburgh, UT 24369</li>, <li>Investment Round: C</li>, <li>Purpose: Reduced logistical contingency for whiteboard end-to-end applications</li>]
I want to extract name and position earlier I was using indexing but it was dynamic could anyone advise how to extract name and purpose.
My edited code after feedback :
page=requests.get("http://3.85.131.173:8000/random_company")
soup=BeautifulSoup(page.content,"html.parser")
info_list=soup.find_all("li")
print(info_list)
name=[]
purpose=[]
I am now able to print name and location successfully. it is giving following output ['Name: Burnett and Sons'] suppose if I want only Burnett and Sons then what should I do? Could any advise?