Scraping products from shopee using python requests returns 90309999

351 Views Asked by At

Since 2022, I was able to scrap shopee listings using python requests with headers User-Agent and From only. However, since last week, I've been receiving error code number 90309999 from {"is_customized":false,"is_login":false,"action_type":2,"error":90309999,"tracking_id":"583f2b10-6b13-4402-8b3b-a6b8f0fead62"}

Also, I've checked this stackoverflow thread and added headers x-api-source and af-ac-enc-dat, but isn't working. Any suggestions?

from requests import Session

base_url = 'https://shopee.com.br/search?filters=9&keyword=funko&locations=Nacional&noCorrection=true&page=0&sortBy=relevancy'

headers = {
    'User-Agent': 'Googlebot',
    'From': '',
    'af-ac-enc-dat': '',
    'x-api-source': 'pc',
}

with Session() as s:
    s.get(base_url, headers=headers)

Don't want to use Selenium or Scrapy for this task, thanks!

EDIT: Also, I've insert null to af-ac-enc-dat but same results are shown.

1

There are 1 best solutions below

3
On

Do you need to scrape using the Googlebot user agent? How about just using a Mozilla user agent?

import requests

headers = {
    "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0",
    "From": "",
    "af-ac-enc-dat": "",
    "x-api-source": "pc",
}

params = {
    "filters": "9",
    "keyword": "funko",
    "locations": "Nacional",
    "noCorrection": "true",
    "page": "0",
    "sortBy": "relevancy",
}

with requests.Session() as session:
    response = session.get("https://shopee.com.br/search", params=params, headers=headers)
    print(response)