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")
#print(type(questions[0]))
print(questions[0].attrs)

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:

print(response)

or

print(response.text)

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)

print(result.text)

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

print(doc.prettify())

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

print(prices)

prices[0].parent

It shows this error.

"IndexError Traceback (most recent call last)
in
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?