paulodarosa / shopee-scraper

Shopee Scraper. A web scraper in python that extract sales, price, avaliable stock, location and more of a given seller.
MIT License
24 stars 7 forks source link

changed ".br" to ".my" ---fail to run #1

Closed tomsyaf closed 1 year ago

tomsyaf commented 1 year ago

Exception has occurred: KeyError 'data' File "C:\Users\apit's Desktop\Documents\myCode\Shopee\scrape.py", line 17, in num_ads = (r.json()['data']['sections'][0]['data']['item'])


KeyError: 'data'
paulodarosa commented 1 year ago

Hi. How's it going, @tomsyaf?

Looks like Shopee uses a different API or endpoint to provide data to users based on Malaysia/or using the .my domain.

Since the script was made to provide data from the Brazilian market, I'm going to close this topic not as an issue, but I'll add this specific point in a future development.

I'll probably follow these steps:

  1. Validate which API Shopee uses to deliver data to users based on Malaysia;
  2. Check the seller's localition (using this specific API);
  3. With steps 1 and 2 I can easily switch the end point inside the script, then it will scrap the data.

Thank you for opening this issue and letting me know about this.

tomsyaf commented 1 year ago

Hi. How's it going, @tomsyaf?

Looks like Shopee uses a different API or endpoint to provide data to users based on Malaysia/or using the .my domain.

Since the script was made to provide data from the Brazilian market, I'm going to close this topic not as an issue, but I'll add this specific point in a future development.

I'll probably follow these steps:

  1. Validate which API Shopee uses to deliver data to users based on Malaysia;
  2. Check the seller's localition (using this specific API);
  3. With steps 1 and 2 I can easily switch the end point inside the script, then it will scrap the data.

Thank you for opening this issue and letting me know about this.

Thanks, i guess i can't use your code and get it to work then. lol