title: Scraping text in h3 and div tags using beautifulSoup, Python
body: <p>I have no experience with python, BeautifulSoup, Selenium etc. but I'm eager to scrape data from a website and store as a csv file.
  A single sample of data I need is coded as follows (a single row of data).</p>
  
  <pre><code>&lt;div class="box effect"&gt;
  &lt;div class="row"&gt;
  &lt;div class="col-lg-10"&gt;
      &lt;h3&gt;HEADING&lt;/h3&gt;
          &lt;div&gt;&lt;i class="fa user"&gt;&lt;/i&gt;&amp;nbsp;&amp;nbsp;NAME&lt;/div&gt;
          &lt;div&gt;&lt;i class="fa phone"&gt;&lt;/i&gt;&amp;nbsp;&amp;nbsp;MOBILE&lt;/div&gt;
          &lt;div&gt;&lt;i class="fa mobile-phone fa-2"&gt;&lt;/i&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;NUMBER&lt;/div&gt;
          &lt;div&gt;&lt;i class="fa address"&gt;&lt;/i&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;XYZ_ADDRESS&lt;/div&gt;
      &lt;div class="space"&gt;&amp;nbsp;&lt;/div&gt;
  
  &lt;div style="padding:10px;padding-left:0px;"&gt;&lt;a class="btn btn-primary btn-sm" href="www.link_to_another_page.com"&gt;&lt;i class="fa search-plus"&gt;&lt;/i&gt; &amp;nbsp;more info&lt;/a&gt;&lt;/div&gt;
  
  &lt;/div&gt;
  &lt;div class="col-lg-2"&gt;
  
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The output I need is
   <code>Heading,NAME,MOBILE,NUMBER,XYZ_ADDRESS</code></p>
  
  <p>I found those data don't have a id or class yet being in website as general text.
  I'm trying BeautifulSoup and Python Selenium separately for that, where I got stuck to extract in both the methods as no tutorials I saw, guided me to extract text from these  and  tags</p>
  
  <p>My code using BeautifulSoup</p>
  
  <pre><code>import urllib2
  from bs4 import BeautifulSoup
  import requests
  import csv
  
  MAX = 2
  
  '''with open("lg.csv", "a") as f:
    w=csv.writer(f)'''
  ##for i in range(1,MAX+1)
  url="http://www.example_site.com"
  
  page=requests.get(url)
  soup = BeautifulSoup(page.content,"html.parser")
  
  for h in soup.find_all('h3'):
      print(h.get('h3'))
  </code></pre>
  
  <p>My selenium code</p>
  
  <pre><code>import csv
  from selenium import webdriver
  MAX_PAGE_NUM = 2
  driver = webdriver.Firefox()
  for i in range(1, MAX_PAGE_NUM+1):
    url = "http://www.example_site.com"
    driver.get(url)
    name = driver.find_elements_by_xpath('//div[@class = "col-lg-10"]/h3')
    #contact = driver.find_elements_by_xpath('//span[@class="item-price"]')
  #  phone = 
  #  mobile = 
  #  address =
  #  print(len(buyers))
  #  num_page_items = len(buyers)
  #  with open('res.csv','a') as f:
  #    for i in range(num_page_items):
  #      f.write(buyers[i].text + "," + prices[i].text + "\n")
    print (name)          
  driver.close()
  </code></pre>