title: Web Scraping - printing values together - Python
body: <p>So I'm trying to scrape CS:GO skins, I'm trying to return: Skin name, Price and collection - in that order.</p>
  
  <p>This is one of many ways I have tried it.</p>
  
  <pre><code>from bs4 import BeautifulSoup
  import requests
  import urllib3
  urllib3.disable_warnings()
  
  def webscrape():
  
      url = "https://csgostash.com/weapon/AWP"
      res = requests.get(url = url)
      soup = BeautifulSoup(res.text, "html.parser")
  
      titles = soup.find_all('div', class_="well result-box nomargin")
      prices = soup.find_all('div', class_="price")
      collection = soup.find_all('div', class_="collection")
  
      for title in titles:
          title = title.find('a')
          if title:
              title = title.text
  
      for price in prices:
          price = price.find('p')
          if price:
              price = price.text
  
      for cases in collection:
          cases = cases.find('p')
          if price:
              cases = cases.text
      print(title.text, price.text, collection.text)
  
  webscrape()
  </code></pre>
  
  <p>This returns:</p>
  
  <pre><code>    print(title.text, price.text, collection.text)
  AttributeError: 'NoneType' object has no attribute 'text'
  </code></pre>
  
  <p>I want it to return the three values in order.
  E.G. 
  Containment Breach '\n'
  A$40.57 -A$271.90'\n'
  Shattered Web Case</p>
  
  <p>and so on. Some of the skins have 2 Price sets, and I want both price sets to print out.</p>
  
  <p>I have gotten it working more to show what I'm struggling with</p>
  
  <pre><code>from bs4 import BeautifulSoup
  import requests
  import urllib3
  urllib3.disable_warnings()
  
  def webscrape():
  
      url = "https://csgostash.com/weapon/AWP"
      res = requests.get(url = url)
      soup = BeautifulSoup(res.text, "html.parser")
      names = " "
      price = " "
      cases = " "
      titles = soup.find_all('div', class_="well result-box nomargin")
      prices = soup.find_all('div', class_="price")
      collection = soup.find_all('div', class_="collection")
  
      for name in titles:
          a_field = name.find('a')
          if a_field:
              names = a_field.text + '\n' + names
  
      for money in prices:
          p_field = money.find('p')
          if p_field:
              price = p_field.text + '\n' + price
  
      for case in collection:
          case_field = case.find('p')
          if case_field:
              cases = case_field.text + '\n' + cases
      print(names, price, cases)
  
  webscrape()
  </code></pre>
  
  <p>This prints all the information I am looking for on the webpage but i want the information grouped together, like i want the prices and the collection for the skin to print under the name of the skin. Right now it prints all the name, then all the prices, then all the collections.</p>