from urllib.request import *
from http.cookiejar import *
url = 'http://www.kuaidaili.com/proxylist/8/'
cookies = MozillaCookieJar()
hander = HTTPCookieProcessor(cookies)
opener = build_opener(hander)
install_opener(opener)
html = urlopen(url).read()
print(html)
这个网页访问是需要cookie的,我用上述方法访问,显示:httperror:521错误异常
This is the strategy of this website. Your first visit will return 512, but the page still has content
He hides important keys in js and performs conversion jumps through the eval function, which plays a role in confusing the code. Using selenium may be able to solve this problem