Python:使用request_html时出现websockets.exceptions.ConnectionClosed错误

时间:2019-02-20 07:16:53

标签: python websocket python-3.6 python-requests-html

我正在使用 getInProgressItem(): any { // tslint:disable-next-line:only-arrow-functions // tslint:disable-next-line:typedef const a = this.queue.pipe(filter((result, id): any => { return result.filter((x) => x.inProgress() === true); })); return a; } getSuccussItem(): any { // tslint:disable-next-line:only-arrow-functions // tslint:disable-next-line:typedef // tslint:disable-next-line:no-unused const b = this.queue.pipe(filter((result, id): any => { return result.filter((x) => x.isSuccess() === true); })); return b; } <span *ngIf="(getInProgressItem().length > 0 | async)" class="c-fileupload__indicator">Uploading</span> <span *ngIf="(getSuccussItem().length > 0 | async)" class="c-fileupload__indicator">Uploaded</span> 库,如下所示:

requests_html

每隔一段时间我会收到此错误:

from requests_html import HTMLSession  


for url in urls:
    ...
    session = HTMLSession() 
    r = session.get(url)
    r.html.render() 
    ...

并且代码被卡在那里并且不执行任何操作。 有没有办法使代码继续并处理for循环中的下一个URL?

0 个答案:

没有答案