-
카테고리
-
세부 분야
데이터 분석
-
해결 여부
미해결
시가총액 긁어오기
19.08.18 11:57 작성 조회수 215
0
아무리 해도 결과값은 []만 뜨고 끝입니다..
뭐가 문제일까요?ㅠㅠ
다른 것은 또 잘 되는 것 같은뎅...
파이참 ide 사용 중 입니다.
from bs4 import BeautifulSoup
import re
import urllib.request as e
url = "https://www.inflearn.com/roadmaps"
res = e.urlopen(url).read()
bs = BeautifulSoup(res, 'lxml')
List = bs.find_all("label", {"class":"left"})
i = 1
for a in List:
print(i, a.string)
i += 1
from bs4 import BeautifulSoup
import re
import urllib.request as e
url = "http://finance.daum.net/"
res = e.urlopen(url).read()
bs = BeautifulSoup(res, 'lxml')
money = bs.find_all('a', class_ = "list boxKospi")
print(money)
from bs4 import BeautifulSoup
import re
import urllib.request as e
url = "http://finance.daum.net/"
res = e.urlopen(url).read()
bs = BeautifulSoup(res, 'lxml')
money = bs.select("#boxMarketTrend > div.box_contents > div:nth-child(6) > div:nth-child(1)")
print(money)
답변을 작성해보세요.
0
좋은사람
지식공유자2019.08.18
안녕하세요. 열심히 하시네요.
해당 예제는 공지와 같이 카카오에서 보안이 강화되어 아래 소스로 변경되었습니다.
https://github.com/eunki7/python_create_app_1/blob/master/section2/2-7-1_new_1.py
위에 소스랑 비교하면서 실행하시면 파싱이 가능합니다.
감사합니다.
답변 1