Python Forum
Dataframe error help - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: Dataframe error help (/thread-4009.html)



Dataframe error help - migs2173 - Jul-16-2017

Hi anyone can help me this error problem im having this error" Dataframe object has no attribute irow" what would be the solution getting the error on line 3 and line 27

def readExcel(index):
   global sheet
   row=sheet.irow(index).real
   if str(row[4])=='nan':
       row[4]=""
   return row[3]+" "+row[4]+" "+row[5],row[1],row[4],row[3]+" "+row[5],row[2],row[1]

session = requests.Session()
LINKEDIN_URL = 'https://www.linkedin.com'
LOGIN_URL = 'https://www.linkedin.com/uas/login-submit'
html = session.get(LINKEDIN_URL).content
soup = BeautifulSoup(html,'html5lib')
csrf = soup.find(id="loginCsrfParam-login")['value']

login_information = {
   'session_key':username,
   'session_password':password,
   'loginCsrfParam': csrf,
}

headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:31.0) Gecko/20100101 Firefox/31.0'}
session.post(LOGIN_URL, headers=headers, data=login_information)
device= build("customsearch","v1",developerKey="API_KEY_REMOVED") 

for j in range(Start_Index,Last_Index):
   print j
   r,c,m,o,nd,com=readExcel(j)

   try:
       results=device.cse().list(q=r+" "+c,num=1,cx='009259153963367271982:fkxfnawlcn4').execute()   # cx: 018365894794576624310:ubawqf09zme      ,       005187750176123224094:h3ylihk-rmi
       #print results
       link=results['items'][0]['formattedUrl']
       #print link
       if j==37:
           link="http://"+link
       html=session.get(link).content
   except  Exception as e:
       print 'Error:',
       print e
       writeDataFrame(j,com,nd,m,"NA","NA","NA","NA")
       continue



RE: Dataframe error help - Ofnuts - Jul-17-2017

What are the imports?


RE: Dataframe error help - migs2173 - Jul-18-2017

hi ofNuts here are imports

import pandas
from bs4 import BeautifulSoup
import re
import requests
from sys import *
from googleapiclient.discovery import build
from openpyxl import load_workbook #VERSION 1.8.5 ONLY
import xlsxwriter
import fuzzy