看板 Python 關於我們 聯絡資訊
今天在爬一個國外的網頁 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 想請問版上大神有無解方<(_ _)> -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.112.171 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1627968795.A.BA1.html
kevin1732: 搜了一下,這是cloudflare的防爬,放header也沒用 08/03 16:35
kevin1732: 可能需要使用 cloudscraper 08/03 16:36
kevin1732: 不過我沒有實做,看看就好 XD 08/03 16:36
B01201026: arning-Python-day14/ 08/03 20:51
B01201026: 用urlopen就可以了,奇怪 08/03 20:51