擅长:python、mysql、java
<p>这将使用以浮点秒为单位的超时值来完成此操作:</p>
<pre><code>import socket
from selenium import selenium
from django.test import TestCase
class TestSelenium(TestCase):
def setUp(self):
socket.settimeout(30)
# ...
self.selenium.start()
</code></pre>
<p>参考<a href="http://docs.python.org/2/library/socket.html#socket.socket.settimeout" rel="nofollow">python stdlib docs</a></p>