How to Automate Publishing to CSDN and WeChat MP Using Playwright (When APIs Fail) A developer automated article publishing to CSDN and WeChat MP using Playwright after CSDN deprecated its public Open API. The solution injects Markdown content into CSDN's dynamic editor via page.evaluate() and handles title input with keyboard simulation. The developer also fixed session log capture after a Claude Code update changed the log file path. Today's focus was on automating article publishing to CSDN and WeChat MP 微信公众号 using Playwright, after CSDN deprecated its public Open API. Key achievements include: injecting Markdown content into CSDN's dynamic editor, handling title input quirks, implementing QR code login for WeChat MP, updating the Dev.to API publisher, and consolidating platform configs into a single YAML file. We also fixed session log capture after a Claude Code update changed the log file path. Background : In early 2026, CSDN silently shut down its public Open API. All endpoints returned 404/403. We needed a fallback to keep publishing to China's largest developer platform. Solution : Use Playwright to simulate a real user login and article creation. The approach: csdn cookies.json . Code snippet : python import asyncio from playwright.async api import async playwright async def publish to csdn title: str, content md: str : async with async playwright as p: browser = await p.chromium.launch headless=True context = await browser.new context storage state="csdn cookies.json" if exists else None page = await context.new page await page.goto "https://mp.csdn.net/mp blog/creation/editor" Inject content await page.evaluate f''' = {{ const editor = document.querySelector '.editor-content' ; if editor {{ editor.innerHTML = {escaped content} ; editor.dispatchEvent new Event 'input', {{ bubbles: true }} ; }} }}''' Fill title await page.fill ' title-input', title await page.click 'button:has-text "发布" ' await page.wait for url " /mp blog/manage/article " if not exists: await context.storage state path="csdn cookies.json" await browser.close Result : First run requires manual QR scan; subsequent runs are fully automated. The browser approach is 3–5 seconds slower than an API call, but it works. Problem : CSDN's Markdown editor is not a simple