Issue
I got the following response in my scrapy code:
[ [ "1-2809328194", "SHREE RAYESHWAR INSTITUTE OF ENGINEERING AND INFORMATION TECHNOLOY", "SHIV SHAIL, KARAI, SHIRODA, GOA 403103", "NORTH GOA", "Unaided - Private", "N", "N", "1-13315171" ], [ "1-2809364960", "AGNEL INSTITUTE OF TECHNOLOGY AND DESIGN", "ASSAGAO,\r\nBARDEZ,\r\nGOA.", "NORTH GOA", "Unaided - Private", "N", "N", "1-792836711" ], [ "1-2809439609", "GOA COLLEGE OF PHARMACY", "18TH JUNE ROAD,PANAJI-GOA", "NORTH GOA", "Government", "N", "N", "1-12606241" ], [ "1-2809451721", "GOA COLLEGE OF ART", "ALTINHO,\r\nPANAJI - GOA\r\n403 001", "NORTH GOA", "Government", "N", "N", "1-34323441" ], [ "1-2809452173", "PADRE CONCEICAO COLLEGE OF ENGINEERING", "AGNEL GANV, VERNA, GOA - 403722", "SOUTH GOA", "Unaided - Private", "N", "N", "1-39482811" ], [ "1-2809476211", "GOVERNMENT POLYTECHNIC CURCHOREM", "OPP. KAKODA INDUSTRIAL ESTATE", "SOUTH GOA", "Government", "N", "N", "1-453010201" ], [ "1-2809500050", "AGNEL INSTITUTE OF FOOD CRAFTS AND CULINARY SCIENCES", "AGNEL TECHNICAL EDUCATION COMPLEX\r\nAGNEL ASHRAM\r\nVERNA", "SOUTH GOA", "Unaided - Private", "N", "N", "1-473844331" ], [ "1-2809505343", "PONDA EDUCATION SOCIETYS RAJARAM AND TARABAI BANDEKAR COLLEGE OF PHARMACY", "PONDA-PANAJI ROAD, FARMAGUDI, PONDA. GOA-403401", "SOUTH GOA", "Unaided - Private", "N", "N", "1-9749331" ], [ "1-2809601268", "GOVERNMENT POLYTECHNIC MAYEM BICHOLIM", "MAYEM BICHOLIM GOA", "NORTH GOA", "Government", "N", "N", "1-455631951" ] ]
How to extract it?
Solution
Your output is nested list, with each list corresponding to single record, you can try below approach:
lets say:
records = [['1-2809328194', 'SHREE RAYESHWAR INSTITUTE OF ENGINEERING AND INFORMATION TECHNOLOY', 'SHIV SHAIL, KARAI, SHIRODA, GOA 403103', 'NORTH GOA', 'Unaided - Private', 'N', 'N', '1-13315171'], ['1-2809364960', 'AGNEL INSTITUTE OF TECHNOLOGY AND DESIGN', 'ASSAGAO,\r\nBARDEZ,\r\nGOA.', 'NORTH GOA', 'Unaided - Private', 'N', 'N', '1-792836711']]
for item in records:
yield {
field1: item[0],
field2: item[1]
.....
.....
}
Answered By - JkShaw
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.