Найти - Пользователи
Полная версия: паук scrapy не проходит по сайту, где что не так? спасибо заранее
Начало » Python для новичков » паук scrapy не проходит по сайту, где что не так? спасибо заранее
1
alexsemen94
 import scrapy
from nettuts.items import NettutsItem
class MySpider(scrapy.Spider):
    name = 'nettuts'
    allowed_domains = ["w3.org"]
    start_url = ["https://www.w3.org/"]
    def parse(self, response):
        for sel in response.xpath('//*[@id="w3c_home_upcoming_events"]/ul/li'):
            item = NettutsItem()
            item['title'] = sel.xpath('/a/text()').extract()
            yield item
scidam
Домены www.w3.org и w3.org разные, попробуйте:
 allowed_domains = ["www.w3.org"]

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB