Open QGB opened 4 years ago
In [3]: from qgb.tests import taobao_trade as tb
In [4]: await tb.get_browser()
[D:pyppeteer.connection.Connection] SEND: {"id": 1, "method": "Target.getBrowserContexts", "params": {}}
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"c385b446-ad70-407b-baad-342d04cb6be6","type":"browser","title":"","url":"","attached":false}}}
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetInfoChanged","params":{"targetInfo":{"targetId":"c385b446-ad70-407b-baad-342d04cb6be6","type":"browser","title":"","url":"","attached":true}}}
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetInfoChanged","params":{"targetInfo":{"targetId":"c385b446-ad70-407b-baad-342d04cb6be6","type":"browser","title":"","url":"","attached":false}}}
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetDestroyed","params":{"targetId":"c385b446-ad70-407b-baad-342d04cb6be6"}}
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"fd8cedde-b1a9-4a43-89bf-f5b99ee155d1","type":"browser","title":"","url":"","attached":false}}}
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetInfoChanged","params":{"targetInfo":{"targetId":"fd8cedde-b1a9-4a43-89bf-f5b99ee155d1","type":"browser","title":"","url":"","attached":true}}}
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetInfoChanged","params":{"targetInfo":{"targetId":"fd8cedde-b1a9-4a43-89bf-f5b99ee155d1","type":"browser","title":"","url":"","attached":false}}}
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetDestroyed","params":{"targetId":"fd8cedde-b1a9-4a43-89bf-f5b99ee155d1"}}
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetDestroyed","params":{"targetId":"B3E5F0CDD7B57ACBE858086130A34907"}}
[D:pyppeteer.connection.Connection] RECV: {"id":1,"result":{"browserContextIds":[]}}
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetDestroyed","params":{"targetId":"D0FBAC7BE20F64FB46E93E9CD6CC9E55"}}
> c:\qgb\anaconda3\lib\site-packages\pyppeteer\browser.py(148)create()
-> await connection.send('Target.setDiscoverTargets', {'discover': True})
(Pdb)
(Pdb) l
143 **kwargs: Any) -> 'Browser':
144 """Create browser object."""
145 browser = Browser(connection, contextIds, ignoreHTTPSErrors,
146 defaultViewport, process, closeCallback)
147 __import__('pdb').set_trace()
148 -> await connection.send('Target.setDiscoverTargets', {'discover': True})
149 return browser
150
151 async def _targetCreated(self, event: Dict) -> None:
152 targetInfo = event['targetInfo']
153 browserContextId = targetInfo.get('browserContextId')
(Pdb) n
[D:pyppeteer.connection.Connection] SEND: {"id": 2, "method": "Target.setDiscoverTargets", "params": {"discover": true}}
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetDestroyed","params":{"targetId":"C6FB4BED4B07AC15E833FBAC1224DCA4"}}
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetDestroyed","params":{"targetId":"6DF338C5092027DE76CEE4553A718830"}}
[I:pyppeteer.connection] connection closed
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"033DE78CA3091ECA3AA66194F8F9337B","type":"background_page","title":"QGB chromExt","url":"chrome-extension://jheifadbnfmeekihgjnhefceljcloihc/_generated_background_page.html","attached":false,"browserContextId":"3F9649BA801D8EFF397B99AD4A5E874D"}}}
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"2625e6c0-ce43-43e7-8e46-6b570cc6a4e3","type":"browser","title":"","url":"","attached":true}}}
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"3A1B260453D7DF0F683D0137BF112173","type":"iframe","title":"https://g.alicdn.com/alilog/oneplus/blk.html#coid=fjklFXHfX0wCAXjkBXlTRYEI&noid=","url":"https://g.alicdn.com/alilog/oneplus/blk.html#coid=fjklFXHfX0wCAXjkBXlTRYEI&noid=","attached":false,"browserContextId":"3F9649BA801D8EFF397B99AD4A5E874D"}}}
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"7F20D659117A42530C4E6398EDDDF43D","type":"background_page","title":"Disable Content-Security-Policy","url":"chrome-extension://ieelmcmcagommplceebfedjlakkhpden/_generated_background_page.html","attached":false,"browserContextId":"3F9649BA801D8EFF397B99AD4A5E874D"}}}
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"B607DFB1417383818FBB7AB22D8BCD31","type":"background_page","title":"Google \u7ffb\u8bd1","url":"chrome-extension://aapbdbdomjkkjkaonfhkkikfgjllcleb/_generated_background_page.html","attached":false,"browserContextId":"3F9649BA801D8EFF397B99AD4A5E874D"}}}
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"C00866B5A63911F8FE8F59B8E9B411DE","type":"background_page","title":"Proxy SwitchyOmega","url":"chrome-extension://padekgcemlokbadohgkifijomclgjgif/background.html","attached":false,"browserContextId":"3F9649BA801D8EFF397B99AD4A5E874D"}}}
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"CD4E17FE825F5CC20394C8D42571C381","type":"page","title":"127.0.0.1:9222/json/version","url":"http://127.0.0.1:9222/json/version","attached":false,"browserContextId":"3F9649BA801D8EFF397B99AD4A5E874D"}}}
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"D2709788649BF36A683AA2F43F1CE567","type":"page","title":"\u6211\u7684\u7ea2\u5305","url":"https://marketingop.taobao.com/cashHongbao.htm?spm=a1z09.2.a2109.d1000376.73cd2e8djnkinV","attached":false,"browserContextId":"3F9649BA801D8EFF397B99AD4A5E874D"}}}
[D:pyppeteer.connection.Connection] RECV: {"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"FFC0D01D8349E82A3FE9A6A0C5940CBB","type":"other","title":"\u4e0b\u8f7d\u5185\u5bb9","url":"chrome://downloads/?bubble","attached":false,"browserContextId":"3F9649BA801D8EFF397B99AD4A5E874D"}}}
[D:pyppeteer.connection.Connection] RECV: {"id":2,"result":{}}
> c:\qgb\anaconda3\lib\site-packages\pyppeteer\browser.py(149)create()
-> return browser
(Pdb)
这里有问题,时间怎么突然跳了一小时??? ··· 2021-07-0700.25.19.298 0 0.031 2021-07-0700.24.17.053 1 0.537 "Evaluation failed: TypeError: Cannot read property 'textContent' of null\n at pyppeteer_evaluation_script:1:59") 2021-07-0700.26.21.035 0 1.733 2021-07-0700.25.19.298 1 2.237 "Evaluation failed: TypeError: Cannot read property 'textContent' of null\n at pyppeteer_evaluation_script:1:59") 2 2.742 "Evaluation failed: TypeError: Cannot read property 'textContent' of null\n at pyppeteer_evaluation_script:1:59") 2021-07-0700.27.23.242 0 3.951 2021-07-0700.26.21.035 1 4.458 "Evaluation failed: TypeError: Cannot read property 'textContent' of null\n at pyppeteer_evaluation_script:1:59") 2021-07-0700.28.24.959 0 5.628 2021-07-0700.27.23.242 1 6.134 "Evaluation failed: TypeError: Cannot read property 'textContent' of null\n at pyppeteer_evaluation_script:1:59") 2 6.627 "Evaluation failed: TypeError: Cannot read property 'textContent' of null\n at pyppeteer_evaluation_script:1:59") 2021-07-0700.29.27.133 0 7.996 2021-07-0700.28.24.959 1 8.517 "Evaluation failed: TypeError: Cannot read property 'textContent' of null\n at pyppeteer_evaluation_script:1:59") 2 9.015 "Evaluation failed: TypeError: Cannot read property 'textContent' of null\n at pyppeteer_evaluation_script:1:59") 2021-07-0701.18.59.530 0 0.268 2021-07-0700.29.27.133 1 0.766 "Evaluation failed: TypeError: Cannot read property 'textContent' of null\n at pyppeteer_evaluation_script:1:59") 2 1.271 "Evaluation failed: TypeError: Cannot read property 'textContent' of null\n at pyppeteer_evaluation_script:1:59") 2021-07-0701.20.01.765 0 2.535 2021-07-0701.18.59.530 1 3.031 2021-07-0701.18.59.530 2 3__. ···
会出现一个 莫名其妙的
去掉就可以正常 except KeyboardInterrupt: