Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

async #12

Open
QGB opened this issue Oct 20, 2020 · 2 comments
Open

async #12

QGB opened this issue Oct 20, 2020 · 2 comments

Comments

@QGB
Copy link
Owner

QGB commented Oct 20, 2020

signal.signal(signal.SIGINT,U.exit)
signal.signal(signal.SIGTERM,U.exit)

会出现一个 莫名其妙的

C:\QGB\babun\cygwin\bin>python qgb\N\websocket_server.py
2020-10-20__16.29.05__.257 run_until_complete done!
2020-10-20__16.29.05__.257 call_later
<frame at 0x000001790CF82BE8, file 'C:\\QGB\\Anaconda3\\lib\\selectors.py', line 314, code _select>

去掉就可以正常 except KeyboardInterrupt:

@QGB
Copy link
Owner Author

QGB commented Nov 12, 2020



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)

@QGB
Copy link
Owner Author

QGB commented Jul 6, 2021

这里有问题,时间怎么突然跳了一小时???
···
2021-07-07__00.25.19__.298
0 0__.031 2021-07-07__00.24.17__.053
1 0__.537 "Evaluation failed: TypeError: Cannot read property 'textContent' of null\n at pyppeteer_evaluation_script:1:59")
2021-07-07__00.26.21__.035
0 1__.733 2021-07-07__00.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-07__00.27.23__.242
0 3__.951 2021-07-07__00.26.21__.035
1 4__.458 "Evaluation failed: TypeError: Cannot read property 'textContent' of null\n at pyppeteer_evaluation_script:1:59")
2021-07-07__00.28.24__.959
0 5__.628 2021-07-07__00.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-07__00.29.27__.133
0 7__.996 2021-07-07__00.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-07__01.18.59__.530
0 0__.268 2021-07-07__00.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-07__01.20.01__.765
0 2__.535 2021-07-07__01.18.59__.530
1 3__.031 2021-07-07__01.18.59__.530
2 3__.
···

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant