href태그1 파이썬 웹 크롤링(Web Crawler) a 태그 안에 href 이미지 긁어오기 BeautifulSoup을 이용한 웹 긁어오기 from urllib.request import * from bs4 import BeautifulSoup http = "URL" html = urlopen(http + "images") soup = BeautifulSoup(html, "html.parser") link_temp = "" image_local_name = "" for link in soup.findAll('a'): if 'href' in link.attrs: link_temp = link.attrs['href'] try: image_local_name = link_temp.split('.')[0] urlretrieve(http + link_temp, li.. 2020. 8. 1. 이전 1 다음