[python] requests와 BeautifulSoup4로 웹 크롤링하기
·
Programming/PYTHON
오늘은 심심해서 웹 크롤링을 통해 파이썬 파일 하나로 주가를 한번에 보려고 한다. 먼저 사전에 필요한 것은 터미널을 통해 설치해둔다. 1) requests 설치 - Python의 http request 라이브러리 > pip install requests 2) BeautifulSoup4 설치 - html을 Python이 이해하는 객체 구조로 Parsing하는 라이브러리 > pip install beautifulsoup4 카카오, 마이크로소프트, 애플의 주가를 확인해봐야겠다. 네이버에 들어가서 해당 기업들을 검색한다. 내가 필요한 건 딱 이 부분이다. 크롬에서 F12를 눌러 개발자모드 창을 띄운다. 그리고 개발자모드 창의 왼쪽 상단 엘리먼트 선택자를 클릭해 필요한 부분으로 커서를 옮긴다. 대충 저 노란 부분..
[Level 2] 더 맵게 - Java
·
Coding Test/Programmers
코딩테스트 연습 - 더 맵게 매운 것을 좋아하는 Leo는 모든 음식의 스코빌 지수를 K 이상으로 만들고 싶습니다. 모든 음식의 스코빌 지수를 K 이상으로 만들기 위해 Leo는 스코빌 지수가 가장 낮은 두 개의 음식을 아래와 같 programmers.co.kr 내 풀이 import java.util.*; class Solution { public int solution(int[] scoville, int K) { int answer = 0; PriorityQueue pq = new PriorityQueue(); for (int sco : scoville) { pq.offer(sco); } while (pq.peek() < K) { if (pq.size() < 2) return -1; int sco1 = p..
[Level 2] 기능개발 - Java
·
Coding Test/Programmers
코딩테스트 연습 - 기능개발 프로그래머스 팀에서는 기능 개선 작업을 수행 중입니다. 각 기능은 진도가 100%일 때 서비스에 반영할 수 있습니다. 또, 각 기능의 개발속도는 모두 다르기 때문에 뒤에 있는 기능이 앞에 있는 programmers.co.kr 내 풀이 import java.util.*; class Solution { public ArrayList solution(int[] progresses, int[] speeds) { ArrayList answer = new ArrayList(); Stack cal = new Stack(); int count = 1; for (int i=progresses.length-1; i>=0; i--) { cal.push((int)(Math.ceil((double)..
[Level 1] 약수의 개수와 덧셈 - Java
·
Coding Test/Programmers
코딩테스트 연습 - 약수의 개수와 덧셈 두 정수 left와 right가 매개변수로 주어집니다. left부터 right까지의 모든 수들 중에서, 약수의 개수가 짝수인 수는 더하고, 약수의 개수가 홀수인 수는 뺀 수를 return 하도록 solution 함수를 완성해주 programmers.co.kr 내 풀이 import java.util.*; class Solution { public int solution(int left, int right) { int answer = 0; for (int i=left; i
[Level 1] k번째 수 - Java
·
Coding Test/Programmers
코딩테스트 연습 - K번째수 [1, 5, 2, 6, 3, 7, 4] [[2, 5, 3], [4, 4, 1], [1, 7, 3]] [5, 6, 3] programmers.co.kr 내 풀이 import java.util.*; class Solution { public int[] solution(int[] array, int[][] commands) { int[] answer = new int[commands.length]; for (int k=0; k
[git] 자주 쓰는 git 명령어 정리
·
MEMO
1. git init$ git initInitialized empty Git repository in C:[path]현재 디렉터리 아래에 .git 디렉터리를 만들고, 여기에 git 저장소 초기화하기 2. git status$ git statusOn branch masterNo commits yetUntracked files: (use "git add ..." to include in what will be committed) [files]nothing added to commit but untracked files present (use "git add" to track)현재 git 저장소 상태 확인하기 3. git add$ git add .커밋할 파일 추가하기 4. git commit$ git c..
[mybatis] org.apache.ibatis.binding.BindingException: Parameter '[parameter-name]' not found
·
ERROR
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter [parameter-name]' not found. Available parameters are [arg1, arg0, param1, param2] 보통 이 에러는 크게 두 가지 유형으로 나누어지는 것 같다. 1. 오타나 공백이 있다. 2. 오타나 공백이 없으나 매개변수를 제대로 넘겨주지 않았다. 1번의 경우 다시 한번 꼼꼼히 찾아보면 확인할 수 있으니 넘어가고, 오늘은 2번의 경우이다. 먼저 에러가 났다는 지점을 찾아가보자. 이 부분이다. followbackCck 함수에 mem_ing_id, me..
[java] java.lang.IllegalStateException: Ambiguous handler methods mapped for HTTP path '/[path-name]'
·
ERROR
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalStateException: Ambiguous handler methods mapped for HTTP path '/[path-name]' IllegalStateException은 잘못된 때에 메소드가 불려갔을 때 발생하는 에러이다. 뒤에 적힌 Ambiguous handler methods mapped for HTTP path '/[path-name]'를 보니 한 가지 path에 매핑된 메소드가 여러 개인 게 문제인 것 같다. 나의 경우 이런 식으로 "/quitpage.action"이 중복되어 있었..