繁体   English   中英

Python requests-HTML 库有时不起作用

[英]Python requests-HTML library doesn't work sometimes

我遇到了同样的问题。 我最终重试了渲染,到目前为止它对我有用。

for attempt in range(3):
    try:
        r2.html.render()
        #do something
    except:
        time.sleep(5) # not sure if this is needed
        print(attempt)
    else: 
        break
else:
     print('all attempts failed')

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM