gspread 라이브러리 설치 문제
안녕하세요!gspread 라이브러리 설치를 완료했는데도 불구하고 No module named 'gspread' 이라는 에러가 나서 진행을 못하고 있습니다 어떻게 해야할까요 ㅜ_ㅜ
설치 이후에 주피터노트북 껐다키고 안되서 재부팅까지 해봤지만 에러가 납니다!
g_hyeeeee
1
1
크롤링한 데이터에서 다시 크롤링할 때 발생하는 에러
안녕하세요!
혼자 해보는데 계속 안돼서 강의를 보고 그대로 코드를 따라 적었는데요, 그래도 계속 오류가 납니다ㅠㅠ 어디가 잘못된걸까요?
cr7268
0
2
[] 혹은 none으로 나올때
안녕하세요!
select 혹은 select_one 을 사용해
특정 태그를 출력했을때 none 혹은 []으로 출력되는건 어떤 현상일까요? 소스보기를 했을떄 텍스트가 분명히 존재하는걸 확인해서 추출하면 none 혹은 []으로 나옵니다.
Seungmin Chu
0
1
설치 후에도 No module named 'gspread' 가 사라지지 않습니다
안녕하세요!
이번코스의 마지막 3강좌를 코앞에 두고 있습니다. 꼼꼼한 설명 덕분에 신나게 공부할 수 있었어요!
그런데 캡쳐사진과 같이 gspread 의 모듈 인스톨이 되지 않습니다. 아예 컴퓨터 재기동까지도 해보았지만 결과는 같아 검색해보니 경로가 달라 그럴 수 있다고 합니다. 하지만 cmd 에서 where python, where pip3, where pip 로 확인하니 모두 같은 경로에 있었습니다. python->python38-32->Lib->site-packages 에도 gspread가 설치된 것도 확인했습니다. 검색을 계속 해보고있지만 어디가 문제인지 아직 잘 모르겠습니다. 어딘가 놓치거나 잘못 설정을 한 건 아닌지 여쭤보고 싶습니다..
Suhyeon Song
0
1
google api
APIError Traceback (most recent call last)
<ipython-input-18-b560380e48d4> in <module>
----> 1 sheet=client.open('minitest').sheet1
~\Anaconda3\lib\site-packages\gspread\models.py in sheet1(self)
74 def sheet1(self):
75 """Shortcut property for getting the first worksheet."""
---> 76 return self.get_worksheet(0)
77
78 def __iter__(self):
~\Anaconda3\lib\site-packages\gspread\models.py in get_worksheet(self, index)
201
202 """
--> 203 sheet_data = self.fetch_sheet_metadata()
204
205 try:
~\Anaconda3\lib\site-packages\gspread\models.py in fetch_sheet_metadata(self)
182 url = SPREADSHEET_URL % self.id
183
--> 184 r = self.client.request('get', url, params=params)
185
186 return r.json()
~\Anaconda3\lib\site-packages\gspread\client.py in request(self, method, endpoint, params, data, json, files, headers)
77 return response
78 else:
---> 79 raise APIError(response)
80
81 def list_spreadsheet_files(self):
APIError: {
"error": {
"code": 403,
"message": "Google Sheets API has not been used in project 415810789407 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/sheets.googleapis.com/overview?project=415810789407 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"status": "PERMISSION_DENIED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"description": "Google developers console API activation",
"url": "https://console.developers.google.com/apis/api/sheets.googleapis.com/overview?project=415810789407"
}
]
}
]
}
}구글 아이디가 두개여서 두번을 해봤는데 sheet=client.open('').sheet1에서 계속 이 오류가 뜹니다.어떻게 해결해야 하나요?
수진안
0
1
파이썬입문과 크롤링기초 부트캠프 [쉽게! 하지만, 견고한 자료로!]
'파이썬입문과 크롤링기초 부트캠프 [쉽게! 하지만, 견고한 자료로!] ' 를 학습하고 있는 직장인 입니다.
네이버 금융에서 '종합정보' 내용은 크롤링 하였습니다. (아래 첨부)
그런데 '종목분석' 의
Financial Summary 에서는 크롤링 되지 않아 메일 드립니다.
현상 : 제가 원하는 당기 순이익(지배) 내용이 나오지 않고 전혀 다른 내용이 나옵니다
바쁘시겠지만 답변 부탁드립니다.
혹시 시간이 되신다면 Sample로 financial summary의 '당기순이익(지배)'
를 크롤링하는 프로그램을 부탁드려도 될까요?
제가 크롤링한 결과는 전혀 다른 내용이 나와서 어디서 잘못되었는지 감을 못잡겠습니다.
import requests
import numpy as np
import pandas as pd
from bs4 import BeautifulSoup
stock_num = ['095570']
#stock_num = ['095570','068400','006840','027410']
for i in stock_num:
URL = "https://finance.naver.com/item/main.nhn?code=" + str(i)
print(URL)
stock_1 = requests.get(URL)
html = stock_1.text
soup = BeautifulSoup(html, 'html.parser')
finance_html = soup.select('div.section.cop_analysis div.sub_section')[0]
stock_name = soup.select('#middle > div.h_company > div.wrap_company > h2 > a')[0]
name = stock_name.get_text()
print(name)
th_data = [item.get_text().strip() for item in finance_html.select('thead th')]
annual_date = th_data[3:7]
quarter_date = th_data[7:13]
#print(annual_date,quarter_date )
finance_index = [item.get_text().strip() for item in finance_html.select('th.h_th2')][3:]
#print(finance_index)
finance_data = [item.get_text().strip() for item in finance_html.select('td')]
#print (finance_data)
import numpy as np
finance_data = np.array(finance_data)
finance_data.resize(len(finance_index), 10)
#print (finance_data)
finance_date = annual_date + quarter_date
import pandas as pd
finance = pd.DataFrame(data=finance_data[0:,0:], index=finance_index, columns=finance_date)
annual_finance = finance.iloc[:, :4]
#quarter_finance = finance.iloc[:, 4:]
#print (annual_finance,quarter_finance )
print (annual_finance)
financial Summary 의 '댱기순이익(지배)' 크롤링하는 예제를 만들어 주시면 유용할것 같습니다.
kwonokun
0
4