스크랩핑 Scraping

크롤링 Crawling

# 크롤링
import urllib.request
url = "<https://img1.daumcdn.net/thumb/R658x0.q70/?fname=https://t1.daumcdn.net/news/202208/19/sportskhan/20220819133522707nahy.jpg>"
savename = "blackpink.jpg"
urllib.request.urlretrieve( url, savename )
print( "저장했습니다" ) 
url = "<http://www.google.com/robots.txt>"
txt = urllib.request.urlopen( url )
data = txt.read().decode( "utf-8" )
# print( data )
with open( "robots.txt", "w", encoding="utf-8" ) as f :
    f.write( data )
print( "저장했습니다" )

머신러닝 데이터 구조

BeutifulSoup 스크래핑