使用Scrapy获取错误

时间:2017-09-04 10:38:55

标签: python

import scrapy

class MyCouponSpyder(scrapy.Spider):
    name = "toscrap-coupon"
    start_urls = ["https://www.groupon.com/coupons/stores/macys.com?c=058fc9a8-01a8-4ff4-b714-dc6dcbc5624f"]

    def parse(self,response):
        for reviews in response.xpath("//div[@class='modal show-modal']"):
            yield {
                 'week_menu':reviews.xpath(".//h2[@class='title']/text()").extract_first(),
                 }

0 个答案:

没有答案