You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Добрый день, при вызове метода Movie.objects.search("Матрица"), Movie.objects.search("Солярис") возникает исключение ValueError: invalid literal for int() with base 10: 'city'.
The text was updated successfully, but these errors were encountered:
Добрый день, при вызове метода Movie.objects.search("Матрица"), Movie.objects.search("Солярис") возникает исключение ValueError: invalid literal for int() with base 10: 'city'.
sources.py
строка 111 (def parse) смени на это и табы правильно выставь
`
def parse(self):
self.content = html.fromstring(self.content)
url = self.extract('url')
years = self.extract('years')
title_en = self.extract('title_en', to_str=True)
rating = self.extract('rating')
if 'afisha' not in url:
self.instance.id = self.prepare_int(url.split('/')[2])
else:
pass
self.instance.title = self.extract_title()
self.instance.series = 'сериал' in self.extract('title')
if years:
self.instance.year = self.prepare_int(years[:4])
if 'мин' in title_en:
values = title_en.split(', ')
self.instance.runtime = self.prepare_int(values[-1].split(' ')[0])
self.instance.title_en = ', '.join(values[:-1])
else:
self.instance.title_en = title_en
if rating:
rating = rating.split(' ')
self.instance.rating = float(rating[0])
self.instance.votes = self.prepare_int(rating[1][1:-1])
self.instance.set_source('link')
Добрый день, при вызове метода Movie.objects.search("Матрица"), Movie.objects.search("Солярис") возникает исключение ValueError: invalid literal for int() with base 10: 'city'.
The text was updated successfully, but these errors were encountered: