I am very new to python. Long time user of stackoverflow but first time posting a question. I am trying to extract data from website using beautifulsoup. Sample Code where I want to extract is (listed in and tagged in data)
The was able to extract in to list but I am unable to extract the acutal data. the goal here is to extract Listed in: Nail Polish Subscription Boxes, Subscription Boxes for Beauty Products, Subscription Boxes for Women Tagged in: Makeup, Beauty, Nail polish
Can you please tell me how to achive it.
import requests
from bs4 import BeautifulSoup
l1=[]
url='http://boxes.mysubscriptionaddiction.com/box/julep-maven'
source_code=requests.get(url)
plain_text=source_code.text
soup= BeautifulSoup(plain_text,"lxml")
for item in soup.find_all('p'):
l1.append(item.contents)
search='\nListed in:\n'
for a in l1:
if a[0] in ('\nTagged in:\n','\nListed in:\n'):
print(a)