Answer the question
In order to leave comments, you need to log in
I don't understand what's wrong with the parser code?
According to the video tutorial, I wrote a parser for a site with games, but when executed, it gives the error
"IndexError: list index out of range"
If you remove "[0].text" from the code at the end, it gives a list of games, but with html elements, help me do this to give a list of games without html elements
import requests
from bs4 import BeautifulSoup as BS
def parse():
URL = requests.get( 'https://stopgame.ru/review/new/stopchoise' )
html = BS( URL.content, 'html.parser' )
for element in html.select( '.item' ):
title = element.select( '.caption > a' )
print( title[0].text )
parse()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question