title: BeautifulSoup get text from child element within container
body: <p>I am trying to scrape used car listing prices and names excluding those posted by a dealership. I am having trouble as I would like to put this in a dataframe using panda but can only do so once I can get the right information. Here is the code.</p>
  <pre><code>from bs4 import BeautifulSoup as bs4
  import requests
  import csv
  import pandas as pd
  import numpy as np
  
  
  pages_to_scrape=2
  pages=[]
  prices=[]
  names=[]
  
  for i in range(1,pages_to_scrape+1):
    url = 'https://www.kijiji.ca/b-cars-trucks/ottawa/used/page-{}/c174l1700185a49'.format(i)
    pages.append(url)
  
  for item in pages:
    page = requests.get(item)
    soup = bs4(page.text,'html.parser')
    for k in soup.findAll('div', class_='price'):
      if k.find(class_='dealer-logo'):
        continue
      else: 
        price=k.getText()
        prices.append(price.strip())
  </code></pre>
  <p>My code up to here works as intended. Since <code>'dealer-logo'</code> is a child of <code>'price'</code>. However, I am having trouble having this work for the names, as the <code>'title'</code> class is within <code>'info-container'</code> where 'price' is also found.</p>
  <p>As such, <code>abc=soup.find('a', { 'class' : 'title' })</code> returns only the first element of the page when I want it to iterate through every listing that does not have <code>'dealer-logo'</code> in it, and findAll obviously wouldn't work as it would give every element. findNext gives me a NoneType.</p>
  <pre><code>  for l in soup.findAll('div', class_='info-container'):
      if l.findAll(class_='dealer-logo'):
        continue
      else:
        abc=soup.find('a', { 'class' : 'title' })
        name=abc.getText()
        names.append(name.strip())
  
  print(names)
  print(prices)
  </code></pre>
  <p>Below is the code I am scraping. I want to ignore all instances where <code>'dealer-logo'</code> is present, and get the price and title for the listing and add it to a list.</p>
  <p><a href="https://i.stack.imgur.com/W31E1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W31E1.png" alt="Here is the HTML code" /></a></p>