Gertje823 / Vinted-Scraper

This is a tool to scrape/download images and data from Vinted & Depop using the API and stores the data in a SQLite database.
GNU General Public License v3.0
91 stars 21 forks source link

Scraper stops due to SQlite error #22

Closed Gnome739 closed 1 year ago

Gnome739 commented 2 years ago

I've been getting the ""r" is not defined" error as the other person who posted before did,

I've also been getting this SQlite error:

Traceback (most recent call last): File "C:\Users\gnome739\Vinted-Scraper-main\scraper.py", line 588, in download_depop_data(userids) File "C:\Users\gnome739\Vinted-Scraper-main\scraper.py", line 552, in download_depop_data c.execute( sqlite3.OperationalError: table Depop_Data has no column named Images

I think it might be when it hits a video?

Thanks

Gertje823 commented 2 years ago

Yep, I recently changed the database table where the Depop data is stored and did not test the video downloading. Thanks for opening the issue. Should be fixed now.

Gnome739 commented 2 years ago

Wow, quick response & fix!

Just tried and and afraid got another error

Traceback (most recent call last): File "C:\Users\gnome739\Vinted-Scraper-main\scraper.py", line 588, in download_depop_data(userids) File "C:\Users\gnome739\Vinted-Scraper-main\scraper.py", line 429, in download_depop_data product_id = product_data['id'] TypeError: 'Response' object is not subscriptable

Thanks

Gertje823 commented 2 years ago

Did the script download something before this error? Or did you get this error straight away? I will try to look into it tomorrow

Gnome739 commented 2 years ago

Sorry yep got about 200 or so pictures in then threw the error. Wasn't a video I don't think. Will try a couple of other accounts and see if any patterns emerge.

Gertje823 commented 1 year ago

I still can't reproduce the error you are getting. The only thing I can think of is the pass on line 427. I changed it into continue. Could you checkout this branch and let me know if this solves you issue?

Gnome739 commented 1 year ago

Hello,

Unfortunately that didn't work.

So it only seems to do it on certain accounts.

One such account is "japexclothing", it downloads 285 images before stopping with that error. Always stops at the beginning of a post. Other accounts however it runs absolutely fine and will do the whole lot.

Thanks for looking into this!

Gertje823 commented 1 year ago

Hmmm, for some reason the api returns products that are not online anymore. https://webapi.depop.com/api/v2/product/japexclothing-burberry-nova-check-skirt-iconic https://www.depop.com/products/japexclothing-burberry-nova-check-skirt-iconic/

With the user you mentioned I got the same error. I fixed it by skipping the product if the api returns a 404 status code.

Could you check out this branch and let me know if this also works for you?

Gnome739 commented 1 year ago

Nice one, that looks to have fixed it.

Cheers.