Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Im using scrapy with python to crawl course information out of university website. I have the code but its not crawling information out and not

Im using scrapy with python to crawl course information out of university website. I have the code but its not crawling information out and not giving me any output. I would appreciate if someone can look at it and tell me what im doing wrong.

image text in transcribedspider.py

image text in transcribed

items.py

image text in transcribedoutput

Thank you

import scrapy from course.items import CourseItem cLass CourseSpider(scrapy.Spider): nameCourse allowed-domain = ['www . wayne . edu'] start-urls ['https://eiprod .wayne.edu/classschedule/201601/courses_new.cfm%3FSubj-PSL.htm1'] def parse(self, response) for scrape in response.xpath( //table/tr): item -CourseItem() item[ 'name'] scrape . xpath('' " "td [@id="homeContainer"]/div[2]/table/tbody/tr[1]/td [2]/a/text () " " " ) . extract () item['courseid'] scrape . xpath (.. " "tdl@id="honeContainer"]/div[2]/table/tbody/tr[1]/td [1]/text ( )""").extract() yield item import scrapy from course.items import CourseItem cLass CourseSpider(scrapy.Spider): nameCourse allowed-domain = ['www . wayne . edu'] start-urls ['https://eiprod .wayne.edu/classschedule/201601/courses_new.cfm%3FSubj-PSL.htm1'] def parse(self, response) for scrape in response.xpath( //table/tr): item -CourseItem() item[ 'name'] scrape . xpath('' " "td [@id="homeContainer"]/div[2]/table/tbody/tr[1]/td [2]/a/text () " " " ) . extract () item['courseid'] scrape . xpath (.. " "tdl@id="honeContainer"]/div[2]/table/tbody/tr[1]/td [1]/text ( )""").extract() yield item

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

5. Identify three characteristics of the dialectical approach.

Answered: 1 week ago

Question

6. Explain the strengths of a dialectical approach.

Answered: 1 week ago

Question

4. Explain the strengths and weaknesses of each approach.

Answered: 1 week ago