Proxy with Tor:
with sync_playwright() as p:
browser = p.chromium.launch(channel="chrome", proxy={
"server": "per-context"})
context = browser.new_context(
proxy={"server": "socks://127.0.0.1:9050"})
获取页面加载完成的Response数据:
_def handle_response(response):
print(response.url)
page = context.new_page()
page.on("response", handle_response)