我是否因请求太多而使应用程序服务器过载?
Am I overloading the application server with too many requests?
我是每两秒加载一次网站,还是总是在网站重新加载后立即重新加载,这有什么不同吗?
因此,如果我使用 python 和 selenium 并且页面或其子目录每两秒打开一次,或者在子目录可用时立即打开?或者服务器可能超载了。
for each in self.all:
self.driver.get(each)
或
WebDriverWait(self.driver, 60).until(
EC.presence_of_element_located((By.TAG_NAME, 'p')))
self.driver.get(each)
是的,这很重要。如果您要在短时间内发出很多请求,您会收到一个 429
状态码,这意味着您发出了太多请求。此外,您可能会收到验证码或触发其他安全内容。
就而言
- Selenium automates browsers. That's it!
- What you do with that power is entirely up to you.
我在你的代码块中没有发现任何问题涉及:
- 遍历
get()
个请求。
- 为
presence_of_element_located()
诱导 WebDriverWait
唯一的灰色区域是 visibility_of_element_located()
的 expected_conditions of presence_of_element_located()
. If your usecase is to extract the text you must induce
参考资料
您可以在以下位置找到一些相关讨论:
注意事项
不要向不允许服务条款的网站发送自动查询,否则您可能会被阻止。
我是每两秒加载一次网站,还是总是在网站重新加载后立即重新加载,这有什么不同吗? 因此,如果我使用 python 和 selenium 并且页面或其子目录每两秒打开一次,或者在子目录可用时立即打开?或者服务器可能超载了。
for each in self.all:
self.driver.get(each)
或
WebDriverWait(self.driver, 60).until(
EC.presence_of_element_located((By.TAG_NAME, 'p')))
self.driver.get(each)
是的,这很重要。如果您要在短时间内发出很多请求,您会收到一个 429
状态码,这意味着您发出了太多请求。此外,您可能会收到验证码或触发其他安全内容。
就
- Selenium automates browsers. That's it!
- What you do with that power is entirely up to you.
我在你的代码块中没有发现任何问题涉及:
- 遍历
get()
个请求。 - 为
presence_of_element_located()
诱导 WebDriverWait
唯一的灰色区域是 visibility_of_element_located()
presence_of_element_located()
. If your usecase is to extract the text you must induce 参考资料
您可以在以下位置找到一些相关讨论:
注意事项
不要向不允许服务条款的网站发送自动查询,否则您可能会被阻止。