скребков. Вот мой код. Я использую шаблон паука scrapy basi c и получаю ошибку поиска DNS. в чем моя ошибка?
class TopmoviesSpider(scrapy.Spider):
name = 'topmovies'
allowed_domains = ['www.imdb.com']
start_urls = ['https://https://www.imdb.com/chart/top/']
def parse(self, response):
movies = response.xpath("//td[@class='titleColumn']/a")
for movie in movies:
link = movie.xpath(".//@href").get()
yield response.follow(url=link, callback=self.scrape_movie)
def scrape_movie(self,response):
rating = response.xpath("//span[@itemprop='ratingValue']/text()").get()
for mov in response.xpath("//div[@class='title_wrapper']"):
yield {
'title': mov.xpath(".//h1/text()").get(),
'year_of_release': mov.xpath(".//span/a/text()").get(),
'duration': mov.xpath(".//div[@class='subtext']/time/text()").get(),
'genre': mov.xpath(".//div[@class='subtext']/a/text()").get(),
'date_of_release': mov.xpath("//div[@class='subtext']/a[2]/text()"),
'rating': rating
}