简体   繁体   English

如何绕过503 BS4 python

[英]How to bypass 503 BS4 python

How can I bypass 503 with BS4如何使用 BS4 绕过 503

Selenium works for a long time, so I would not want to use it Selenium 工作了很长时间,所以我不想使用它

site to request网站请求

changing user-agent did not help更改用户代理没有帮助

there is no cycle in the code, this error arrives from the first request代码中没有循环,这个错误是从第一个请求到达的

header = {
    'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
    'accept-language': 'en-US,en;q=0.8',
    'upgrade-insecure-requests': '1',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36'
}

I did just我只是

import requests
r = requests.get("https://mangalib.me/")

and got 503 too, in r.text I found that也得到了 503,在r.text中我发现

  <noscript>
    <h1 data-translate="turn_on_js" style="color:#bd2426;">Please turn JavaScript on and reload the page.</h1>
  </noscript>

and later然后

<div id="no-cookie-warning" class="cookie-warning" data-translate="turn_on_cookies" style="display:none">
  <p data-translate="turn_on_cookies" style="color:#bd2426;">Please enable Cookies and reload the page.</p>
</div>
<p data-translate="process_is_automatic">This process is automatic. Your browser will redirect to your requested content shortly.</p>
<p data-translate="allow_5_secs" id="cf-spinner-allow-5-secs" >Please allow up to 5 seconds&hellip;</p>

So I suspect you need tool with JavaScript support if you want to access this page所以我怀疑如果你想访问这个页面,你需要支持 JavaScript 的工具

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

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