Scrape Douyin Hot List on Android with Charles, Appium, and mitmproxy

This tutorial explains how to capture and analyze Douyin's hot list data on Android by setting up Charles proxy, installing required certificates, intercepting traffic, and automating the process with Appium and mitmproxy, providing step‑by‑step instructions and key code snippets.

Python Crawling & Data Mining
Python Crawling & Data Mining
Python Crawling & Data Mining
Scrape Douyin Hot List on Android with Charles, Appium, and mitmproxy

This article shares a simple method to analyze and capture data from the Douyin (TikTok) hot list on Android.

Since the data is not available on a web page, we need to intercept the app's network traffic using Charles proxy.

Set up Charles

Download and install Charles (a paid proxy tool; a Chinese‑localized version is available). After installation, open Charles and configure the proxy.

On the phone, set the proxy to the computer's IP address and port 8888, ensuring both devices are on the same LAN.

Install certificates

Install the Charles root certificate on both the PC and the mobile device (Help → SSL Proxy → Install Charles Root Certificate). On the phone, open chls.pro/ssl to download the certificate, then go to Settings → Security → Install from SD card.

Capture Douyin hot list data

Open Charles, launch the Douyin app, and navigate to the hot list page. The request URL appears in Charles and returns 50 items.

The endpoint only returns data for the current moment; obtaining newer data requires changing complex parameters, which is beyond the scope of this guide.

Automate data collection

Use Appium to periodically control the phone and mitmproxy to intercept the traffic. The Appium script repeatedly fetches the latest hot list, while the mitmproxy script filters requests whose URL matches the hot list endpoint.

Before using mitmproxy, set the phone's proxy IP and port to 127.0.0.1:8080.

Include the first two lines in the script to avoid runtime errors.

Use if url in flow.request.url to identify Douyin hot list requests.

Run the script from its directory.

Running the Appium automation completes the data collection process.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AndroidmitmproxyAppiumdata-scrapingCharles ProxyDouyin
Python Crawling & Data Mining
Written by

Python Crawling & Data Mining

Life's short, I code in Python. This channel shares Python web crawling, data mining, analysis, processing, visualization, automated testing, DevOps, big data, AI, cloud computing, machine learning tools, resources, news, technical articles, tutorial videos and learning materials. Join us!

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.