1

I'm trying to build web Scraper using BeautifulSoup , but when i'm compiling the code it gives find_all method has no attributes. Here is the code :

page = requests.get("https://www.bing.com/images/search")
soup = BeautifulSoup(page.content,'html.parser')

print(soup.find_all('a'))

week = soup.find(id='b_results')
print(week.find_all('li'))
      
  • This is a runtime error, not a compiler error, just FYI. If you're trying to scrape bing, very likely [see this](https://stackoverflow.com/questions/8049520/web-scraping-javascript-page-with-python). – ggorlen Dec 31 '19 at 00:28

1 Answers1

0

The reason you are getting this error is because there isn't anything with the id b_results, so nothing is assigned to week, so when you try to find all in nothing it errors out.

3ddavies
  • 546
  • 2
  • 19