[파이썬 웹 스크래핑] User Agent
import requests url = "http://danny610.tistory.com" # User-Agent 정보 : https://www.whatismybrowser.com/detect/what-is-my-user-agent headers = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36"} res = requests.get(url, headers=headers) res.raise_for_status() with open("mygoogle.html", "w", encoding="utf8") as f: f.wri..
프로그래밍 언어/웹 스크래핑
2020. 8. 28. 07:00