500 读取超时 Selenium:打开具有大量记录的网站时
我将 Perl 与 Selenium 一起使用。我已经设置了 $sel->set_timeout("86400000");
。
打开内容较多的网站时,显示500读取超时消息。有人可以帮我吗?
I am using Perl with Selenium. I have set $sel->set_timeout("86400000");
.
When opening a website with large content, 500 read timeout message is displayed. Can someone please help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我看来,不是 Selenium Webdriver(客户端)发出超时,而是 Web 服务器等待太久了。
你想完成什么?也许您可以发出 HTTP HEAD 请求来检查您的 URL 是否有效? (HEAD 请求不会返回任何内容,只是返回带有 http 状态代码的 HTTP 标头以及可选的“Content-Length”标头以及其他字段。HEAD 请求比 GET 或 POST 请求和您不会遇到超时问题。例如,如果您的请求被重定向到另一台服务器,
那么我现在无法帮助您。 足够的信息。
您可以使用 用于创建 HEAD 请求的 Test::WWW::Mechanize 对象(它是 LWP::Request 的子类)不确定 selenium 是否支持 head 请求。
It seems to me that not the Selenium webdriver (the client) has issued the timeout, but the webserver has been waiting too long.
What do you want to accomplish? Maybe you can just make a HTTP HEAD request to check that your URL is valid? (A HEAD request does not give you any content back, just the HTTP header with the http status code and, optionally, the "Content-Length" header, among other fields. The HEAD request is much faster that a GET or POST request and yo won't have problems with timeouts. You might get more than one HEAD respnses e.g. if your request is redirected to another server.
Or do you want to check the large content itself. Then I cannot help you at this point. There is not enough information.
You can use a Test::WWW::Mechanize object to create the HEAD request (it is a subclass of LWP::Request). NOt sure if selenium supports head requests.