Challenge - Scrape a Book Store!

my code accuracy is 98%. please check what mistake I made in code.

import requests
from tqdm import tqdm
import pandas as pd
import string
from bs4 import BeautifulSoup
url1=“http://books.toscrape.com/catalogue/page-
img=[]
title=[]
price=[]
for i in tqdm(range(1,51)):

url=url1+str(i)+".html"

resp=requests.get(url)
book_soup=BeautifulSoup(resp.content)

l=book_soup.findAll('article',{'class':'product_pod'})
for book in l:
    
    img.append(book.img.attrs['src'])
    
    title.append(book.h3.a.attrs['title'])
    
    price.append(book.findAll('div',{'class':'product_price'})[0].p.text)

d={‘image_url’:img,‘book_title’:title,‘product_price’:price}
df=pd.DataFrame(d)
df.to_csv(“submission.csv”,index=False)

Hey @Abhishek-Vishwakarma-653004358467067, it’s great that you achieved 98% accuracy. That is the maximum accuracy that you can achieve for this challenge.

Hope this resolves your doubt :slight_smile:
Happy Learning !

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.