title: How to apply my function to all list items "li class" on page in eBay Scraper
body: <p>New to python and BeautifulSoup.</p>
  <p>I'm having trouble applying my function to all the list items (li class) on this eBay sold items page.</p>
  <p><strong>Each sold listing is displayed as an li class.</strong> Below is the URL.</p>
  <p><a href="https://www.ebay.com/sch/i.html?_from=R40&amp;_nkw=2017+patrick+mahomes+psa+10+auto&amp;_sacat=0&amp;LH_TitleDesc=0&amp;LH_Complete=1&amp;LH_Sold=1&amp;_ipg=100" rel="nofollow noreferrer">https://www.ebay.com/sch/i.html?_from=R40&amp;_nkw=2017+patrick+mahomes+psa+10+auto&amp;_sacat=0&amp;LH_TitleDesc=0&amp;LH_Complete=1&amp;LH_Sold=1&amp;_ipg=100</a></p>
  <p>Here is my code...</p>
  <pre><code>def rookie_card_info(url):
      r = requests.get(url)
      
      soup = bs(r.content)
      
      contents = soup.prettify()
      
      rookie_card_list = soup.find_all(class_=&quot;srp-results srp-list clearfix&quot;)
      
      #How to to apply to all list items
      
      display_image = soup.find(class_=&quot;s-item__image-img&quot;)
      img_src = display_image.get('src')
      test = Image(img_src)
      display(test)
      print(img_src)
  
      display_card = soup.find(class_=&quot;s-item__link&quot;)
      card_title = display_card.find(&quot;h3&quot;)
      get_card_title = card_title.text
      print(get_card_title)
  
      display_sold_price = soup.find(class_=&quot;s-item__detail s-item__detail--primary&quot;)
      card_sold_price = display_sold_price.find(&quot;span&quot;)
      sold_price_text = card_sold_price.find(class_=&quot;POSITIVE&quot;)
      print(sold_price_text.string)
  
      display_sold_date = soup.find(class_=&quot;s-item__ended-date s-item__endedDate&quot;)
      card_sold_date = display_sold_date.string
      print(card_sold_date)
      
  rookie_card_info(&quot;https://www.ebay.com/sch/i.html?_from=R40&amp;_nkw=2017+patrick+mahomes+psa+10+auto&amp;_sacat=0&amp;LH_TitleDesc=0&amp;LH_Complete=1&amp;LH_Sold=1&amp;_ipg=100&quot;)
  </code></pre>
  <p>I wrote the below line of code in an attempt to identify the specific class on the page that encompasses all <strong>li class</strong> objects on the sold results page (there are about 65 results).</p>
  <pre><code>rookie_card_list = soup.find_all(class_=&quot;srp-results srp-list clearfix&quot;)
  </code></pre>
  <p>When I print the html from this line of code. It contains all of the correct html I would need to parse for my data.</p>
  <p><strong>The data I am parsing for is the image URL, title, sold date, and sold price.</strong></p>
  <p>I get the correct data as shown below...</p>
  <pre><code>https://i.ebayimg.com/thumbs/images/g/2BwAAOSwETVfzAFT/s-l225.jpg
  2017 Armed &amp; Dangerous Patrick Mahomes Auto MINT Condition PSA 10? Rookie Signed
  $2,500.00
  Dec-27 12:46
  </code></pre>
  <p>However, I only get the data from the very first &quot;li class&quot; listing on the page. and not the data for all 65 results.</p>
  <p><strong>Question:</strong></p>
  <p><strong>What can I do to get data for all 65 results. I need a &quot;plug in and play&quot; solution that I can apply to different URLs.</strong></p>