When trying the Web scaping lesson I get the Error List Index out of range

I am practicing with the lesson of Web Scraping and I am applying the following program

import requests
from bs4 import BeautifulSoup
response = requests.get("https://stackoverflow.com/questions")
soup = BeautifulSoup(response.text, "html.parser")
questions = soup.select(".question-summary")

I am getting the error
IndexError: list index out of range

I would appreciate any help as to why this error is happenning

Greetings. Could be that the information that StackOverflow is returning is not an indexable type. Try:




After getting a response to see what the get response is returning

Thank you. I will check and follow up with you.

It looks like the page structure has changed on stackoverflow. Try:

questions = soup.select(“.s-post-summary.js-post-summary”)

instead of:

questions = soup.select(“.question-summary”)

and use “.s-link” instead if “.question-hyperlink” for the title

Thank you so much. I will try it when i get well.

I am facing a similar issue.
The following is my code.

url = “Drawing Book Junior Series 7" x 10" (10pcs/Pkt) | Golden Tiger Stationery Store

result = requests.get(url)


doc = BeautifulSoup(result.text,“html.parser”)


prices = doc.find_all(string= “Ks.”)



It shows this error.

"IndexError Traceback (most recent call last)
1 prices = doc.find_all(string= “Ks.”)
2 print(prices)
----> 3 prices[0].parent

IndexError: list index out of range"

Is there anyway to resolve this?