Scrape a Book Store

I’ve created a CSV file using Beautiful Soup. I am pretty confident that my scrapped file is correct (I matched few of the entries with the website), but it’s still showing an accuracy of 13% on submitting the file. Can you please tell me, what is the error?

Here is the link to my code-

hey @LPLC0059 ,
the problem you are facing is because of the extra qoutes that you are adding using this code

if ind==1:
string+=’"{}"’.format(k)+’,’
else:
string+=k+’,’

you just need to add quotes to sentences which contains commas between in them.
So you need to replace the above code with :

if ind==1:
if “,” in k:
string+=’"{}"’.format(k)+’,’
else:
string+=k+’,’
else:
string+=k+’,’

I will improve your score .
I hope this would have helped you.
Thank You and Happy Learning :slightly_smiling_face:.

Now it’s showing 0% Accuracy, but the file seems fine to me. Please help!

Have you implemented the same code like this

Yes. I can even mail you the CSV file, if you provide your email id.

yeah kindly send me at
[email protected]

I’ve sent you the same.

yep, Got it.
Checking it.

hey , kindly check the file that you are submitting .
It is showing me score as 97 on the submission of your file.

I checked it thoroughly. But still the same accuracy (0%). Maybe there’s some problem with site then. I’ll try to submit it after some time, and then get back to you.

Yeah It might be.
okay , No problem.
Else i would suggest you to move on with the reset part of the course , you have achieved a score 97 and i have checked it too. So just don’t worry about this.

Okay, Thank you so much!

It’s showing 97% accuracy now. Might be some glitch in the website that time. Thank You!
Also, can you please tell me where is the 3% error, if possible :sweat_smile:

1 Like

yeah , that is actually some mistakes in actual file on which the score is being calculated.
Some image paths are incorrect. That’s the only reason you get this 3% error.
Don’t worry it will be corrected. So , for now you have got 100% accuracy.
Well Done.

Okay, Thank you. I had posted another doubt related to writing spider for scrappy yesterday, but have not got any response till now. So shall I wait for the reply on that doubt or can I post the doubt here?

Just wait for that doubt there only , it will soon be resolved.

Other than that, if this doubt is now resolved , then i would request you too kindly mark this as resolved and also provide your valuable feedback with it.

This url gives 98% accuracy because of the change in the image url
http://books.toscrape.com/catalogue/page-1.html

This is the correct url which gives 100% result
http://books.toscrape.com/

last url gives first 20 image in this format so it achieves 100% accuracy
media/cache/2c/da/2cdad67c44b002e7ead0cc35693c0e8b.jpg
vs
first url gives first 20 image in this format so it achieves 98% accuracy
…/media/cache/2c/da/2cdad67c44b002e7ead0cc35693c0e8b.jpg

I hope this helps