python爬虫遇到有等待响应的网站怎么爬取

2025-03-03 04:39:42
推荐回答(2个)
回答1:

设置一个
import time

略…
# 做个睡眠时间
t = time.sleep(要睡眠的时间,如05,1,2,)
# 在想写入文件做个判断
with open("文件路径","wb")as f:
f.write(网址,conten)
if == t:
break

回答2:

python + selenium + phantomjs