1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
| import asyncio import json from playwright.async_api import async_playwright
fingerprint = json.dumps( { "dnt":"1", "ua":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36", "ssl_grease":2.0, "canvas_height":1.0, "bluetooth":False, "mobile":False, "memory":9.0, "hardware":9.0, "conn_type":"10g", "conn_rtt":10.0, "battery_level":100.0, "battery_charging":False, "battery_time":99.0, "webaudio":1.0, "screen_pixel":50.0, "screen_awidth":800.0, "screen_aheight":800.0, "screen_width":900.0, "screen_height":900.0, "webrtc_public":"183.242.254.114", "webrtc_private":"192.168.252.119", "webgl_vendor":"ruyi", "productSub":"20240501", "vendor":"ruyi", "canvas_y":1.0, "font":1.0 }, separators=(',', ':'))
async def main(): async with async_playwright() as p: browser=await p.chromium.launch( executable_path="C:\\chromium119\\src\out\\release\\chrome.exe", args=[ f"--jack={fingerprint}", "--headless=new" ], ) page=await browser.new_page() await page.goto("https://bot.sannysoft.com/") await page.screenshot(type='png', path='./screen.png', full_page=True) print('程序运行完毕')
asyncio.run(main())
|