I am crawling the names of the colleges on this webpage, but, i also want to crawl the number of faculties in these colleges which is available if open the specific webpages of the colleges by clicking the name of the college.
What should i append to this code to get the result. The result should be in the form of [(name1, faculty1), (name2,faculty2),... ]
import scrapy
class QuotesSpider(scrapy.Spider):
name = "student"
start_urls = [
'http://www.engineering.careers360.com/colleges/list-of-engineering-colleges-in-karnataka?sort_filter=alpha',
]
def parse(self, response):
for students in response.css('li.search-result'):
yield {
'name': students.css('div.title a::text').extract(),
}
Should be something like this. So you send the name of the student in the meta data of the request. That allows you to request it in your next request.
If the data is also available on the last page you scrape in
parse_student
you might want to consider not sending it in the meta data but just to scrape it from the last page.