[问题] 加了headers还是回应403

楼主: B01201026 (星空萤火虫)   2021-08-03 13:33:12
今天在爬一个国外的网页
https://aflcio.org/executive-paywatch/highest-paid-ceos?combine=&industry=
All&state=All&sp500=1&page=1
我即便把整串headers都放上去
'accept'
'accept-encoding'
'accept-language'
'cache-control'
'cookie'
'if-modified-since'
'sec-ch-ua'
'sec-ch-ua-mobile':
'sec-fetch-dest'
'sec-fetch-mode'
'sec-fetch-site'
'sec-fetch-user'
'upgrade-insecure-requests'
'user-agent'
依旧回应403
想请问版上大神有无解方<(_ _)>
作者: kevin1732 (BLACK)   2021-08-03 16:35:00
搜了一下,这是cloudflare的防爬,放header也没用可能需要使用 cloudscraper不过我没有实做,看看就好 XD
楼主: B01201026 (星空萤火虫)   2021-08-03 20:51:00
https://jenifers001d.github.io/2019/12/22/Python/learning-Python-day14/用urlopen就可以了,奇怪

Links booklink

Contact Us: admin [ a t ] ucptt.com