๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ‘จ๐Ÿผ‍๐Ÿ’ป๊ฐœ๋ฐœ/ํŒŒ์ด์ฌ

ํŒŒ์ด์ฌ - Cloudflare ์šฐํšŒํ•˜์—ฌ ํฌ๋กค๋งํ•˜๊ธฐ

by Janger 2022. 1. 29.
728x90
๋ฐ˜์‘ํ˜•
pip install cloudscraper

 

import cloudscraper

scraper = cloudscraper.create_scraper()  # returns a CloudScraper instance
# Or: scraper = cloudscraper.CloudScraper()  # CloudScraper inherits from requests.Session
print scraper.get("http://somesite.com").text

๋‚˜๋ฌด์œ„ํ‚ค ๋˜ํ•œ Cloudflare๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์ผ๋ฐ˜์ ์ธ ๋ฐฉ๋ฒ•์œผ๋กœ๋Š” ํฌ๋กค๋ง์ด ํž˜๋“ค๋‹ค. 

๊ทผ๋ฐ ์ด ๋ชจ๋“ˆ ์„ค์น˜ํ•˜๋ฉด ํฌ๋กค๋ง์ด ๊ฐ€๋Šฅํ•ด์ง.

 

์ถœ์ฒ˜: 

https://stackoverflow.com/questions/49087990/python-request-being-blocked-by-cloudflare

 

Python - Request being blocked by Cloudflare

I am trying to log into a website. When I look at print(g.text) I am not getting back the web page I expect but instead a cloudflare page that says 'Checking your browser before accessing' import

stackoverflow.com

 

728x90
๋ฐ˜์‘ํ˜•