Python Forum
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dataframe error help
#1
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
Reply
#2
What are the imports?
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Reply
#3
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
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020