```python `# -*- codeing:utf8 -*- from playwright.sync_api import sync_playwright def baidu(route, request): newurl = request.url+"?direct" print('newurl:',newurl) route.continue_(url=newurl) def run(playwright): chromium = playwright.chromium browser = chromium.launch(headless=False) page = browser.new_page() page.on("response", lambda response: print("Response: " + response.url)) page.route("*robots*", baidu) page.goto("https://www.baidu.com/robots.txt") with sync_playwright() as playwright: run(playwright) ` ``` this code printed `newurl: http://www.baidu.com/robots.txt?direct Response: http://www.baidu.com/robots.txt`