Last active
September 16, 2023 04:52
-
-
Save sunfkny/ca17708a4702486e2199c672e844342a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import httpx | |
client = httpx.Client(http2=True) | |
url = "https://www.tesla.cn/inventory/api/v1/inventory-results" | |
headers = { | |
"Referer": "https://www.tesla.cn/inventory/used/ms?Province=CN&FleetSalesRegions=CN", | |
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36", | |
} | |
params = { | |
"query": '{"query":{"model":"ms","condition":"used","options":{"FleetSalesRegions":["CN"]},"arrangeby":"Price","order":"asc","market":"CN","language":"zh","super_region":"north america","lng":"","lat":"","zip":"","range":0},"offset":0,"count":50,"outsideOffset":0,"outsideSearch":false}' | |
} | |
response = client.get(url, params=params, headers=headers, timeout=2) | |
print(response.json()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment