Answer the question
In order to leave comments, you need to log in
Why does it return an empty list instead of uploading data?
There are no errors in the other part of the code, everything works.
get_html - using requests I send a request to the server
get_html - using bs I parse data
def parser():
PAGENATION = int(input('Введите кол-во страниц: '.strip()))
URL = input('Укажите ссылку на страницу банка: ').strip()
html = get_html(URL)
if html.status_code == 200:
otzivi = []
for page in range(1, PAGENATION):
print(f'Спарсили страницу: {page}')
html = get_html(URL, params = {'page':page})
otzivi.extend(get_content(html.text))
print(otzivi)
else:
print('Ошибка, проверьте соеденение с интернетом')
parser()
Answer the question
In order to leave comments, you need to log in
Viktor Kokorich good day!
perhaps the problem is in this line:
otzivi.extend(get_content(html.text))
- in the get_content() function - maybe html.get_text
()
is correct ?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question