반응형 네이버 증권뉴스 크롤링(2) import pandas as pd import re import requests from bs4 import BeautifulSoup from urllib.request import urlopen from urllib.request import HTTPError from urllib import parse from tqdm import trange data = pd.read_csv("이지케어텍_url.csv") data = data['url'] hh = [] ii = [] for i in trange(len(data)): url = data[i] req = requests.get(url) bs = BeautifulSoup(req.content, "html.parser") div = bs.find_all.. 2020. 7. 27. 네이버 증권뉴스 크롤링(1) import time import pandas as pd import re import requests from bs4 import BeautifulSoup from urllib.request import urlopen from urllib.request import HTTPError from urllib import parse import chardet import math import numpy as np def craw(): news = bs.find_all('dl', {'class' : 'newsList'}) news_list = [] news_list_2 = [] title_list = [] title_list_2 = [] url_list = [] url_list_2 = [] for new in.. 2020. 7. 27. 이전 1 다음 반응형