CGV 상영시간표 알리 CGV 상영시간표 알리미 를 만들어보자! 나만의 내가 나를위해 기록하는 개발일지 삽질일지 언제 오픈될지 모르는 CGV의 상영시간표! 언제 열리나 전전긍긍하며 수시로 들락날락… 그만합시다! 무엇이 필요할까 영화관 데이터 가져오기 상영정보 크롤링 자동화 크롤러 크롤링 서버 ios 앱 상영정보 크롤링 11월 21일 우선 정보를 가져올 수 있어야 시작이 가능하겠지? … 태어나 처음해보는 크롤링 … 웹 크롤링에 대해 검색하니 BeautifulSoup 를 사용해 정보를 가져올 수 있겠다! BeautifulSoup html 코드를 Python이 이해하는 객체 구조로 변환해주는 Parser! 네이버 인기검색어 크롤링 import requests from bs4 import BeautifulSoup html = requests.get('https://naver.com/').text soup = BeautifulSoup(html, 'html.parser') title_list = soup.select('.PM_CL_realtimeKeyword_rolling span[class*=ah_k]') for idx, title in enumerate(title_list, 1): print(idx, title.text) CSS Selector를 사용해 정보를 가져왔다. .PM은 PM이라는 글자가 들어가는 .PM li 는 PM class 밑에 속해 있는 li .PM > li 는 PM class의 직계 li 웹 구조는 변할 수 있으니 범위를 너무 구체적으로 잡지 않도록 주의한다! 생각보다 할만한데…? 야심차게 cgv 홈페이지도 마찬가지 방법으로 시도! 하지만 정보가 나오지 않는다… 왜지? BeautifulSoup를 사용한 크롤링은 검사에서 나오는 html에서가 아니라 페이지...
[Swift Error] Outlets cannot be connected to repeating content. Swift Error: Outlet from the TableViewController to the UILabel is invalid. Outlets cannot be connected to repeating content. 주로 CustomCell을 만들때 발생하는 에러이다. 해당 아울렛을 TableViewController에 연결시킬 수 없다는 에러인데, CustomCell의 클래스를 다음과 같이 CustomCell 클래스를 새롭게 정의하고 그 클래스에 연결시켜주어야 한다. class CustomCell:UITableViewCell { 여기에 connect!! } 다음과 CityStateCell이라는 클래스를 정의했다면, Main.storyboard에 연결시키는것도 잊지말도록 하자.
tensorflow softmax_cross_entropy_with_logits softmax_cross_entropy_with_logits issue 해결 WARNING:tensorflow:From /Users/os/woong/tensorflow/DeepLearningZeroToAll/lab-06-2-softmax_zoo_classifier.py:32: softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version. Instructions for updating: Future major versions of TensorFlow will allow gradients to flow into the labels input on backprop by default. 다음 Warning 해결 softmax_cross_entropy_with_logit 함수를 softmax_cross_entropy_with_logits_v2로 변경하고 파라미터의 labels를 tf.stop_gradient에 넣어서 해결 기존 함수 cost_i = tf.nn.softmax_cross_entropy_with_logits(logits=logits, labels=Y_one_hot) 해결 cost_i = tf.nn.softmax_cross_entropy_with_logits_v2(logits=logits, labels=tf.stop_gradient([Y_one_hot])) c
댓글
댓글 쓰기