목록Python (10)
하고재비
1234567891011121314151617181920212223from urllib.request import urlopenimport urllib.requestfrom bs4 import BeautifulSoup html = urlopen('######################')soup = BeautifulSoup(html, 'lxml') # 996 - 1002pic_main = [] for x in range(996, 1003): pic_main_list = soup.find('img', {'id': 'eListPrdImage' + str(x) + '_1'}).get('src') pic_main.append(pic_main_list) f = open("#################", 'w..
기사내용 TXT 저장 12345678910111213141516171819202122232425from urllib.request import urlopenfrom bs4 import BeautifulSoup html = urlopen('http://news.naver.com/main/read.nhn?mode=LSD&mid=shm&sid1=103&sid2=245&oid=020&aid=0003113573')# html = urlopen('file:///C:/Users/USER/Desktop/songsong.html')#html = urlopen('https://dak.gg/profile/DeadDE/2017-pre6/krjp')soup = BeautifulSoup(html, 'lxml') #nameList..
from urllib.request import urlopen from bs4 import BeautifulSoup for i in range(26600, 26630): URL = 'http://www.inven.co.kr/board/overwatch/4676/' + str(i) html = urlopen(URL) soup = BeautifulSoup(html, 'lxml') contents_1 = soup.find_all('div',{'class':'articleCategory'}) if len(contents_1) != 0: if "[영웅]" in contents_1[0].get_text(): contents = soup.find_all('div', {"class": "articleTitle"}) p..
st = [0 for _ in range(10)] index = 10 value = 0
import os def search(dirname): try: filenames = os.listdir(dirname) for filename in filenames: full_filename = os.path.join(dirname, filename) if os.path.isdir(full_filename): search(full_filename) else: ext = os.path.splitext(full_filename)[-1] if ext == '.py': print(full_filename) except PermissionError: pass search("C:/") if ext == '.py':