[問題] 加了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