Scrape Sendo Với Python: Hướng Dẫn Đầy Đủ
Sendo là sàn TMĐT Việt Nam thuộc FPT. Bài viết hướng dẫn scrape dữ liệu Sendo với Python.
Sendo Có Gì Khác?
- Thuộc tập đoàn FPT
- Focus vào thị trường Việt Nam
- Có SenMall (hàng chính hãng)
- API structure tương tự Tiki
Setup Môi Trường
pip install requests beautifulsoup4 selenium
Phương Pháp 1: Requests + API
import requests
# Sendo search API
url = "https://searchlist-api.sendo.vn/web/products"
params = {
"q": "điện thoại",
"platform": "web",
"page": 1,
"size": 40
}
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
"Accept": "application/json"
}
response = requests.get(url, params=params, headers=headers)
data = response.json()
for product in data.get('data', []):
name = product.get('name')
price = product.get('final_price')
print(f"{name}: {price:,}đ")
Phương Pháp 2: Selenium
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
driver = webdriver.Chrome()
driver.get("https://www.sendo.vn/tim-kiem?q=laptop")
time.sleep(3)
products = driver.find_elements(By.CSS_SELECTOR, ".product-item")
for p in products[:10]:
try:
title = p.find_element(By.CSS_SELECTOR, ".title").text
price = p.find_element(By.CSS_SELECTOR, ".price").text
print(f"{title}: {price}")
except:
pass
driver.quit()
Dữ Liệu Thu Thập Được
- Tên sản phẩm
- Giá gốc, giá sale
- % giảm giá
- Rating và reviews
- Seller info
- SenMall badge
Tips Scraping Sendo
- API approach nhanh hơn HTML
- Delay 1-2s để tránh rate limit
- Handle pagination với page parameter
- Check response status trước khi parse
VinaProxy Cho Sendo
- IP Việt Nam cho speed tối ưu
- Residential IP tránh ban
- Giá chỉ $0.5/GB
