title: looping Row and scraping data taking input from excel file
body: <p>i want to scrape web data using input values from excel and scraping web for each row_value taken and save the output to same excel file.</p>
  
  <pre class="lang-py prettyprint-override"><code>from bs4 import BeautifulSoup
  import requests 
  from urllib import request
  import os
  import pandas as pd
  
  
  ciks = pd.read_csv("ciks.csv")
  ciks.head()
  </code></pre>
  
  <p><em>output</em></p>
  
  <pre><code>    CIK
  0   1557822
  1   1598429
  2   1544670
  3   1574448
  4   1592290
  </code></pre>
  
  <p>then </p>
  
  <pre class="lang-py prettyprint-override"><code>for x in ciks:
      url="https://www.sec.gov/cgi-bin/browse-edgar?CIK=" + x +"&amp;owner=exclude&amp;action=getcompany"
      r = request.urlopen(url)
      bytecode = r.read()
      htmlstr = bytecode.decode()
      soup = BeautifulSoup(bytecode)
      t = soup.find('span',{'class':'companyName'})
      print(t.text)
  </code></pre>
  
  <p>i got an erorr : 
  ----> 9     print (t.text)</p>
  
  <p>AttributeError: 'NoneType' object has no attribute 'text'</p>
  
  <p>here, i want to scrape web data taking each row value as input from the CSV file.</p>