一个用于通过图片|文字在1688.com上搜索产品的Python库。
pip install search1688apifrom search1688api import Sync1688Session
with Sync1688Session(debug = False, proxies = proxies) as session:
# 要修改会话参数,可以直接访问会话对象
session.cookies_dict['_m_h5_tk'] = '我的新令牌_1234567890'
products = session.search_by_image("path/to/image.jpg")
products = session.search_by_text("search query")from search1688api import Async1688Session
import asyncio
async def main():
async with Async1688Session(debug = False, proxies = proxies) as session:
response = await session.search_by_image("path/to/image.jpg")
response = await session.search_by_text("rose-colored glasses")
asyncio.run(main())search_by_image(image_path: str, debug = True) -> List[]
search_by_text(image_path: str, debug = True) -> List[]- image_path - 图像文件路径
- debug - 使用日志记录功能
MIT