이강의도
해결됨
네이버 카페 DB 추출 프로그램 개발 강의 [selenium]
솔직히 들어본 결과 처음에 파이썬 셀레니움 이나 poser 크롬 드라이브 설치부터 0강의에 넣어 두시는 게 ...좋을 거 같아요 추가적으로 GUI강좌 까지 하시면 가격 더 올려도 많은 사람들이 한번 볼 꺼 같습니다 아무튼 같은 부산 사람이라 강의 한번 들었는데 정말 설명을 잘하시네요 ^^
- 웹-크롤링
- flask
- 웹-크롤링
- selenium
172만명의 커뮤니티!! 함께 토론해봐요.
해결됨
네이버 카페 DB 추출 프로그램 개발 강의 [selenium]
솔직히 들어본 결과 처음에 파이썬 셀레니움 이나 poser 크롬 드라이브 설치부터 0강의에 넣어 두시는 게 ...좋을 거 같아요 추가적으로 GUI강좌 까지 하시면 가격 더 올려도 많은 사람들이 한번 볼 꺼 같습니다 아무튼 같은 부산 사람이라 강의 한번 들었는데 정말 설명을 잘하시네요 ^^
미해결
실전! 스프링 데이터 JPA
localhost로 바꾸고 jdbc:h2:~/datajpa 로 작성하고 해도 저렇게 뜨네요 권한도 755로 변경했습니다 어떻게 해야 할까요?
해결됨
실전! 스프링 부트와 JPA 활용2 - API 개발과 성능 최적화
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 여기에 질문 내용을 남겨주세요. 다른건 다 잘 동작하는데 주문 내역 조회를 하면 Whitelabel Error Page This application has no configured error view, so you are seeing this as a fallback. Thu Feb 09 17:10:38 KST 2023 [80f6a090-2] There was an unexpected error (type=Internal Server Error, status=500). An error happened during template parsing (template: "class path resource [templates/order/orderList.html]") org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/order/orderList.html]") at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse( AbstractMarkupTemplateParser.java:241 ) Suppressed: The stacktrace has been enhanced by Reactor, refer to additional information below: Error has been observed at the following site(s): checkpoint ⇢ Handler jpaBook.jpaShop.controller.OrderController#orderList(OrderSearch, Model) [DispatcherHandler] checkpoint ⇢ HTTP GET "/orders" [ExceptionHandlingWebHandler] Original Stack Trace: at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse( AbstractMarkupTemplateParser.java:241 ) at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parseStandalone( AbstractMarkupTemplateParser.java:100 ) at org.thymeleaf.engine.TemplateManager.parseAndProcess( TemplateManager.java:666 ) at org.thymeleaf.TemplateEngine.process( TemplateEngine.java:1103 ) at org.thymeleaf.TemplateEngine.process( TemplateEngine.java:1077 ) at org.thymeleaf.spring6.SpringWebFluxTemplateEngine.lambda$createFullStream$0( SpringWebFluxTemplateEngine.java:198 ) at reactor.core.publisher.MonoCreate.subscribe( MonoCreate.java:58 ) at reactor.core.publisher.InternalMonoOperator.subscribe( InternalMonoOperator.java:64 ) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext( MonoFlatMap.java:165 ) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.complete( MonoIgnoreThen.java:292 ) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onNext( MonoIgnoreThen.java:187 ) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext( MonoIgnoreThen.java:236 ) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete( MonoIgnoreThen.java:203 ) at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onComplete( MonoPeekTerminal.java:299 ) at reactor.core.publisher.MonoWhen$WhenCoordinator.signal( MonoWhen.java:211 ) at reactor.core.publisher.MonoWhen$WhenInner.onComplete( MonoWhen.java:427 ) at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onComplete( MonoPeekTerminal.java:299 ) at reactor.core.publisher.Operators$MonoSubscriber.complete( Operators.java:1840 ) at reactor.core.publisher.MonoCacheTime$CoordinatorSubscriber.signalCached( MonoCacheTime.java:337 ) at reactor.core.publisher.MonoCacheTime$CoordinatorSubscriber.onNext( MonoCacheTime.java:354 ) at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext( FluxPeek.java:200 ) at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext( FluxSwitchIfEmpty.java:74 ) at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onNext( MonoPeekTerminal.java:180 ) at reactor.core.publisher.MonoPublishOn$PublishOnSubscriber.run( MonoPublishOn.java:181 ) at reactor.core.scheduler.SchedulerTask.call ( SchedulerTask.java:68 ) at reactor.core.scheduler.SchedulerTask.call ( SchedulerTask.java:28 ) at java.base/java.util.concurrent.FutureTask.run( FutureTask.java:264 ) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run( ScheduledThreadPoolExecutor.java:304 ) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker( ThreadPoolExecutor.java:1136 ) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run( ThreadPoolExecutor.java:635 ) at java.base/java.lang.Thread.run( Thread.java:833 ) Caused by: org.attoparser.ParseException: Exception evaluating SpringEL expression: " item.member.name " (template: "order/orderList" - line 45, col 21) at org.attoparser.MarkupParser.parseDocument( MarkupParser.java:393 ) at org.attoparser.MarkupParser.parse( MarkupParser.java:257 ) at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse( AbstractMarkupTemplateParser.java:230 ) at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parseStandalone( AbstractMarkupTemplateParser.java:100 ) at org.thymeleaf.engine.TemplateManager.parseAndProcess( TemplateManager.java:666 ) at org.thymeleaf.TemplateEngine.process( TemplateEngine.java:1103 ) at org.thymeleaf.TemplateEngine.process( TemplateEngine.java:1077 ) at org.thymeleaf.spring6.SpringWebFluxTemplateEngine.lambda$createFullStream$0( SpringWebFluxTemplateEngine.java:198 ) at reactor.core.publisher.MonoCreate.subscribe( MonoCreate.java:58 ) at reactor.core.publisher.InternalMonoOperator.subscribe( InternalMonoOperator.java:64 ) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext( MonoFlatMap.java:165 ) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.complete( MonoIgnoreThen.java:292 ) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onNext( MonoIgnoreThen.java:187 ) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext( MonoIgnoreThen.java:236 ) at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete( MonoIgnoreThen.java:203 ) at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onComplete( MonoPeekTerminal.java:299 ) at reactor.core.publisher.MonoWhen$WhenCoordinator.signal( MonoWhen.java:211 ) at reactor.core.publisher.MonoWhen$WhenInner.onComplete( MonoWhen.java:427 ) at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onComplete( MonoPeekTerminal.java:299 ) at reactor.core.publisher.Operators$MonoSubscriber.complete( Operators.java:1840 ) at reactor.core.publisher.MonoCacheTime$CoordinatorSubscriber.signalCached( MonoCacheTime.java:337 ) at reactor.core.publisher.MonoCacheTime$CoordinatorSubscriber.onNext( MonoCacheTime.java:354 ) at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext( FluxPeek.java:200 ) at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext( FluxSwitchIfEmpty.java:74 ) at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onNext( MonoPeekTerminal.java:180 ) at reactor.core.publisher.MonoPublishOn$PublishOnSubscriber.run( MonoPublishOn.java:181 ) at reactor.core.scheduler.SchedulerTask.call ( SchedulerTask.java:68 ) at reactor.core.scheduler.SchedulerTask.call ( SchedulerTask.java:28 ) at java.base/java.util.concurrent.FutureTask.run( FutureTask.java:264 ) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run( ScheduledThreadPoolExecutor.java:304 ) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker( ThreadPoolExecutor.java:1136 ) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run( ThreadPoolExecutor.java:635 ) at java.base/java.lang.Thread.run( Thread.java:833 ) Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: " item.member.name " (template: "order/orderList" - line 45, col 21) at org.thymeleaf.spring6.expression.SPELVariableExpressionEvaluator.evaluate( SPELVariableExpressionEvaluator.java:292 ) at org.thymeleaf.standard.expression.VariableExpression.executeVariableExpression( VariableExpression.java:166 ) at org.thymeleaf.standard.expression.SimpleExpression.executeSimple( SimpleExpression.java:66 ) at org.thymeleaf.standard.expression.Expression.execute( Expression.java:109 ) at org.thymeleaf.standard.expression.Expression.execute( Expression.java:138 ) at org.thymeleaf.standard.processor.AbstractStandardExpressionAttributeTagProcessor.doProcess( AbstractStandardExpressionAttributeTagProcessor.java:144 ) at org.thymeleaf.processor.element.AbstractAttributeTagProcessor.doProcess( AbstractAttributeTagProcessor.java:74 ) at org.thymeleaf.processor.element.AbstractElementTagProcessor.process( AbstractElementTagProcessor.java:95 ) at org.thymeleaf.util.ProcessorConfigurationUtils$ElementTagProcessorWrapper.process( ProcessorConfigurationUtils.java:633 ) at org.thymeleaf.engine.ProcessorTemplateHandler.handleOpenElement( ProcessorTemplateHandler.java:1314 ) at org.thymeleaf.engine.OpenElementTag.beHandled( OpenElementTag.java:205 ) at org.thymeleaf.engine.Model.process( Model.java:282 ) at org.thymeleaf.engine.Model.process( Model.java:290 ) at org.thymeleaf.engine.IteratedGatheringModelProcessable.processIterationModel( IteratedGatheringModelProcessable.java:368 ) at org.thymeleaf.engine.IteratedGatheringModelProcessable.process( IteratedGatheringModelProcessable.java:222 ) at org.thymeleaf.engine.ProcessorTemplateHandler.handleCloseElement( ProcessorTemplateHandler.java:1640 ) at org.thymeleaf.engine.TemplateHandlerAdapterMarkupHandler.handleCloseElementEnd( TemplateHandlerAdapterMarkupHandler.java:388 ) at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler$InlineMarkupAdapterPreProcessorHandler.handleCloseElementEnd( InlinedOutputExpressionMarkupHandler.java:322 ) at org.thymeleaf.standard.inline.OutputExpressionInlinePreProcessorHandler.handleCloseElementEnd( OutputExpressionInlinePreProcessorHandler.java:220 ) at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler.handleCloseElementEnd( InlinedOutputExpressionMarkupHandler.java:164 ) at org.attoparser.HtmlElement.handleCloseElementEnd( HtmlElement.java:169 ) at org.attoparser.HtmlMarkupHandler.handleCloseElementEnd( HtmlMarkupHandler.java:412 ) at org.attoparser.MarkupEventProcessorHandler.handleCloseElementEnd( MarkupEventProcessorHandler.java:473 ) at org.attoparser.ParsingElementMarkupUtil.parseCloseElement( ParsingElementMarkupUtil.java:201 ) at org.attoparser.MarkupParser.parseBuffer( MarkupParser.java:725 ) at org.attoparser.MarkupParser.parseDocument( MarkupParser.java:301 ) ... 32 more Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1021E: A problem occurred whilst attempting to access the property 'name': 'Unable to access property 'name' through getter method' at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty( PropertyOrFieldReference.java:209 ) at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal( PropertyOrFieldReference.java:104 ) at org.springframework.expression.spel.ast.PropertyOrFieldReference$AccessorLValue.getValue( PropertyOrFieldReference.java:405 ) at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal( CompoundExpression.java:92 ) at org.springframework.expression.spel.ast.SpelNodeImpl.getValue( SpelNodeImpl.java:112 ) at org.springframework.expression.spel.standard.SpelExpression.getValue( SpelExpression.java:338 ) at org.thymeleaf.spring6.expression.SPELVariableExpressionEvaluator.evaluate( SPELVariableExpressionEvaluator.java:265 ) ... 57 more Caused by: org.springframework.expression.AccessException: Unable to access property 'name' through getter method at org.springframework.expression.spel.support .ReflectivePropertyAccessor$OptimalPropertyAccessor.read( ReflectivePropertyAccessor.java:685 ) at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty( PropertyOrFieldReference.java:204 ) ... 63 more Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke( DirectMethodHandleAccessor.java:119 ) at java.base/java.lang.reflect.Method.invoke( Method.java:577 ) at org.springframework.expression.spel.support .ReflectivePropertyAccessor$OptimalPropertyAccessor.read( ReflectivePropertyAccessor.java:681 ) ... 64 more Caused by: org.hibernate.LazyInitializationException: could not initialize proxy [jpaBook.jpaShop.domain.Member#1] - no Session at org.hibernate.proxy.AbstractLazyInitializer.initialize( AbstractLazyInitializer.java:164 ) at org.hibernate.proxy.AbstractLazyInitializer.getImplementation( AbstractLazyInitializer.java:309 ) at org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor.intercept( ByteBuddyInterceptor.java:44 ) at org.hibernate.proxy.ProxyConfiguration$InterceptorDispatcher.intercept( ProxyConfiguration.java:102 ) at jpaBook.jpaShop.domain.Member$HibernateProxy$qF4ptgCa.getName(Unknown Source) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke( DirectMethodHandleAccessor.java:104 ) ... 66 more 이러한 오류가 뜹니다. orderList.html 에서 item.member.name 에 접근하려다가 오류가 나는 것 같은데 잘 모르겠어서 질문드립니다.
해결됨
실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
안녕하세요 비즈니스 메서드에 관해 궁금한 게 생겨서 질문드립니다. 강의 중에 엔티티를 변경할 때는 Setter대신 비즈니스 메서드를 별도 작성하여 제공하라고 해주셨는데 1) 등록이나 수정(save, update) 같은 것을 할 때 domain 쪽에 비즈니스 메서드를 작성하라는 뜻이 맞나요? 2) 구글링을 해보니 빌더 패턴, 정적펙토리 메소드 라는 기술도 존재하던데 비즈니스 메서드를 포함한 3가지는 궁극적으로 하는일이 비슷하다고 생각하는데 다른가요?
해결됨
스프링 시큐리티 OAuth2
OAuth2AuthorizationService 구현체를 JdbcOAuth2AuthorizationService로 변경하였습니다. Spring Authorization Server 버전은 1.0 입니다. @Bean public OAuth2AuthorizationService authorizationService(JdbcTemplate jdbcTemplate, RegisteredClientRepository registeredClientRepository) { return new JdbcOAuth2AuthorizationService(jdbcTemplate, registeredClientRepository); } DB Schema : Spring Authorization Server 에서 제공 /* IMPORTANT: If using PostgreSQL, update ALL columns defined with 'blob' to 'text', as PostgreSQL does not support the 'blob' data type. */ CREATE TABLE oauth2_authorization ( id varchar(100) NOT NULL, registered_client_id varchar(100) NOT NULL, principal_name varchar(200) NOT NULL, authorization_grant_type varchar(100) NOT NULL, authorized_scopes varchar(1000) DEFAULT NULL, attributes blob DEFAULT NULL, state varchar(500) DEFAULT NULL, authorization_code_value blob DEFAULT NULL, authorization_code_issued_at timestamp DEFAULT NULL, authorization_code_expires_at timestamp DEFAULT NULL, authorization_code_metadata blob DEFAULT NULL, access_token_value blob DEFAULT NULL, access_token_issued_at timestamp DEFAULT NULL, access_token_expires_at timestamp DEFAULT NULL, access_token_metadata blob DEFAULT NULL, access_token_type varchar(100) DEFAULT NULL, access_token_scopes varchar(1000) DEFAULT NULL, oidc_id_token_value blob DEFAULT NULL, oidc_id_token_issued_at timestamp DEFAULT NULL, oidc_id_token_expires_at timestamp DEFAULT NULL, oidc_id_token_metadata blob DEFAULT NULL, refresh_token_value blob DEFAULT NULL, refresh_token_issued_at timestamp DEFAULT NULL, refresh_token_expires_at timestamp DEFAULT NULL, refresh_token_metadata blob DEFAULT NULL, PRIMARY KEY (id) ); authorization code 발급시 로그인 화면 계정 정보 입력 후 MariaDB에 저장할떄 .BadSqlGrammarException 예외가 발생합니다, 질문1)에러 로그를 보면 insertAuthorization 메소드에서 attribute 컬럼에 Principal Class 자체를 저장하는 과정에서 발생하고 있습니다, 다만, 퀴리를 DB에서 직접 실행하면 저장이 되는것 으로 보아 Spring JDBCTemplate에서 변환시 오루가 발생하는거 같은데 원인이 궁급합니다. private void insertAuthorization(OAuth2Authorization authorization) { List<SqlParameterValue> parameters = this.authorizationParametersMapper.apply(authorization); try (LobCreator lobCreator = this.lobHandler.getLobCreator()) { PreparedStatementSetter pss = new LobCreatorArgumentPreparedStatementSetter(lobCreator, parameters.toArray()); this.jdbcOperations.update(SAVE_AUTHORIZATION_SQL, pss); } } Caused by: java.sql.SQLSyntaxErrorException: (conn=952251) Could not convert [{"@class":"java.util.Collections$UnmodifiableMap"," java.security .Principal":{"@class":" org.springframework.security .authentication.UsernamePasswordAuthenticationToken","authorities":["java.util.Collections$UnmodifiableRandomAccessList",[{"@class":" org.springframework.security .core.authority.SimpleGrantedAuthority","authority":"ROLE_USER"}]],"details":{"@class":" org.springframework.security .web.authentication.WebAuthenticationDetails","remoteAddress":"0:0:0:0:0:0:0:1","sessionId":"B8C2C171954B719820D6592F6102AF9B"},"authenticated":true,"principal":{"@class":" org.springframework.security .core.userdetails.User","password":null,"username":"user1","authorities":["java.util.Collections$UnmodifiableSet",[{"@class":" org.springframework.security .core.authority.SimpleGrantedAuthority","authority":"ROLE_USER"}]],"accountNonExpired":true,"accountNonLocked":true,"credentialsNonExpired":true,"enabled":true},"credentials":null}," org.springframework.security .oauth2.core.endpoint.OAuth2AuthorizationRequest":{"@class":" org.springframework.security .oauth2.core.endpoint.OAuth2AuthorizationRequest","authorizationUri":" http://localhost:9000/oauth2/authorize","authorizationGrantType":{"value":"authorization_code"},"responseType":{"value":"code"},"clientId":"messaging-client","redirectUri":"http://127.0.0.1:8080/login/oauth2/code/messaging-client-oidc","scopes":["java.util.Collections$UnmodifiableSet",["openid"]],"state":null,"additionalParameters":{"@class":"java.util.Collections$UnmodifiableMap","grant_type":"authorization_code"},"authorizationRequestUri":"http://localhost:9000/oauth2/authorize?response_type=code&client_id=messaging-client&scope=openid&redirect_uri=http://127.0.0.1:8080/login/oauth2/code/messaging-client-oidc&grant_type=authorization_code","attributes":{"@class":"java.util.Collections$UnmodifiableMap"} }}] to -4 RegisteredClientRepository는 구현체를 JdbcRegisteredClientRepository 로 변경해도 이상없이 동작 하고 있고 JdbcAuthorizationConsentService는 JdbcOAuth2AuthorizationService 오류로 동의 단게가 진행되지 않아서 확인해보지 않았습니다. 질문2)이외에도Authorization Server에서 blob 컴럼에 Class 자체를 저장하는 사례가 많이 있는데 커스참 구현체를 만들어서 Class 를 저장하지 않고 Authorization Server 필요한 항목만 JSON 으로 저장 하거나 테이블을 정규화 하여 Map 에 담아 주는것이 좋은 방법일까요? 참고로 Attribe는 JwtGenerator에서 보면 nonce 을 가지고 오고 있습니다. if (AuthorizationGrantType.AUTHORIZATION_CODE.equals(context.getAuthorizationGrantType())) { OAuth2AuthorizationRequest authorizationRequest = context.getAuthorization().getAttribute( OAuth2AuthorizationRequest.class.getName()); String nonce = (String) authorizationRequest.getAdditionalParameters().get(OidcParameterNames.NONCE); if (StringUtils.hasText(nonce)) { claimsBuilder.claim(IdTokenClaimNames.NONCE, nonce); } } 에러로그 전문 org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [INSERT INTO oauth2_authorization (id, registered_client_id, principal_name, authorization_grant_type, authorized_scopes, attributes, state, authorization_code_value, authorization_code_issued_at, authorization_code_expires_at,authorization_code_metadata,access_token_value,access_token_issued_at,access_token_expires_at,access_token_metadata,access_token_type,access_token_scopes,oidc_id_token_value,oidc_id_token_issued_at,oidc_id_token_expires_at,oidc_id_token_metadata,refresh_token_value,refresh_token_issued_at,refresh_token_expires_at,refresh_token_metadata) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)] at org.springframework.jdbc.support .SQLExceptionSubclassTranslator.doTranslate( SQLExceptionSubclassTranslator.java:101 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.jdbc.support .AbstractFallbackSQLExceptionTranslator.translate( AbstractFallbackSQLExceptionTranslator.java:70 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.jdbc.core.JdbcTemplate.translateException( JdbcTemplate.java:1538 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.jdbc.core.JdbcTemplate.execute( JdbcTemplate.java:667 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.jdbc.core.JdbcTemplate.update( JdbcTemplate.java:960 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.jdbc.core.JdbcTemplate.update( JdbcTemplate.java:1015 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.security .oauth2.server.authorization.JdbcOAuth2AuthorizationService.insertAuthorization( JdbcOAuth2AuthorizationService.java:211 ) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0] at org.springframework.security.oauth2.server.authorization.JdbcOAuth2AuthorizationService.save ( JdbcOAuth2AuthorizationService.java:189 ) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0] at org.springframework.security .oauth2.server.authorization.authentication.OAuth2AuthorizationCodeRequestAuthenticationProvider.authenticate( OAuth2AuthorizationCodeRequestAuthenticationProvider.java:209 ) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0] at org.springframework.security .authentication.ProviderManager.authenticate( ProviderManager.java:182 ) ~[spring-security-core-6.0.1.jar:6.0.1] at org.springframework.security .oauth2.server.authorization.web.OAuth2AuthorizationEndpointFilter.doFilterInternal( OAuth2AuthorizationEndpointFilter.java:166 ) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0] at org.springframework.web.filter.OncePerRequestFilter.doFilter( OncePerRequestFilter.java:116 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.security .web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:374 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .oauth2.server.authorization.web.OAuth2AuthorizationServerMetadataEndpointFilter.doFilterInternal( OAuth2AuthorizationServerMetadataEndpointFilter.java:84 ) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0] at org.springframework.web.filter.OncePerRequestFilter.doFilter( OncePerRequestFilter.java:116 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.security .web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:374 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.authentication.logout.LogoutFilter.doFilter( LogoutFilter.java:107 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.authentication.logout.LogoutFilter.doFilter( LogoutFilter.java:93 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:374 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.csrf.CsrfFilter.doFilterInternal( CsrfFilter.java:116 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.web.filter.OncePerRequestFilter.doFilter( OncePerRequestFilter.java:116 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.security .web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:374 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.header.HeaderWriterFilter.doHeadersAfter( HeaderWriterFilter.java:90 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.header.HeaderWriterFilter.doFilterInternal( HeaderWriterFilter.java:75 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.web.filter.OncePerRequestFilter.doFilter( OncePerRequestFilter.java:116 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.security .web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:374 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .oauth2.server.authorization.config.annotation.web.configurers.AuthorizationServerContextFilter.doFilterInternal( AuthorizationServerContextFilter.java:61 ) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0] at org.springframework.web.filter.OncePerRequestFilter.doFilter( OncePerRequestFilter.java:116 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.security .web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:374 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.context.SecurityContextHolderFilter.doFilter( SecurityContextHolderFilter.java:82 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.context.SecurityContextHolderFilter.doFilter( SecurityContextHolderFilter.java:69 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:374 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal( WebAsyncManagerIntegrationFilter.java:62 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.web.filter.OncePerRequestFilter.doFilter( OncePerRequestFilter.java:116 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.security .web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:374 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.session.DisableEncodeUrlFilter.doFilterInternal( DisableEncodeUrlFilter.java:42 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.web.filter.OncePerRequestFilter.doFilter( OncePerRequestFilter.java:116 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.security .web.FilterChainProxy$VirtualFilterChain.doFilter( FilterChainProxy.java:374 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.FilterChainProxy.doFilterInternal( FilterChainProxy.java:233 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.security .web.FilterChainProxy.doFilter( FilterChainProxy.java:191 ) ~[spring-security-web-6.0.1.jar:6.0.1] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate( DelegatingFilterProxy.java:351 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.web.filter.DelegatingFilterProxy.doFilter( DelegatingFilterProxy.java:267 ) ~[spring-web-6.0.4.jar:6.0.4] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:185 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:158 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.springframework.web.filter.RequestContextFilter.doFilterInternal( RequestContextFilter.java:100 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.web.filter.OncePerRequestFilter.doFilter( OncePerRequestFilter.java:116 ) ~[spring-web-6.0.4.jar:6.0.4] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:185 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:158 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.springframework.web.filter.FormContentFilter.doFilterInternal( FormContentFilter.java:93 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.web.filter.OncePerRequestFilter.doFilter( OncePerRequestFilter.java:116 ) ~[spring-web-6.0.4.jar:6.0.4] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:185 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:158 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal( CharacterEncodingFilter.java:201 ) ~[spring-web-6.0.4.jar:6.0.4] at org.springframework.web.filter.OncePerRequestFilter.doFilter( OncePerRequestFilter.java:116 ) ~[spring-web-6.0.4.jar:6.0.4] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:185 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:158 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.core.StandardWrapperValve.invoke( StandardWrapperValve.java:177 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.core.StandardContextValve.invoke( StandardContextValve.java:97 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.authenticator.AuthenticatorBase.invoke( AuthenticatorBase.java:542 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:119 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.valves.ErrorReportValve.invoke( ErrorReportValve.java:92 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.core.StandardEngineValve.invoke( StandardEngineValve.java:78 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.catalina.connector.CoyoteAdapter.service( CoyoteAdapter.java:357 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.coyote.http11.Http11Processor.service( Http11Processor.java:400 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.coyote.AbstractProcessorLight.process( AbstractProcessorLight.java:65 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process( AbstractProtocol.java:859 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.tomcat.util.net .NioEndpoint$SocketProcessor.doRun( NioEndpoint.java:1734 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.tomcat.util.net.SocketProcessorBase.run ( SocketProcessorBase.java:52 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker( ThreadPoolExecutor.java:1191 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run( ThreadPoolExecutor.java:659 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run( TaskThread.java:61 ) ~[tomcat-embed-core-10.1.5.jar:10.1.5] at java.base/java.lang.Thread.run( Thread.java:833 ) ~[na:na] Caused by: java.sql.SQLSyntaxErrorException: (conn=952251) Could not convert [{"@class":"java.util.Collections$UnmodifiableMap"," java.security .Principal":{"@class":" org.springframework.security .authentication.UsernamePasswordAuthenticationToken","authorities":["java.util.Collections$UnmodifiableRandomAccessList",[{"@class":" org.springframework.security .core.authority.SimpleGrantedAuthority","authority":"ROLE_USER"}]],"details":{"@class":" org.springframework.security .web.authentication.WebAuthenticationDetails","remoteAddress":"0:0:0:0:0:0:0:1","sessionId":"B8C2C171954B719820D6592F6102AF9B"},"authenticated":true,"principal":{"@class":" org.springframework.security .core.userdetails.User","password":null,"username":"user1","authorities":["java.util.Collections$UnmodifiableSet",[{"@class":" org.springframework.security .core.authority.SimpleGrantedAuthority","authority":"ROLE_USER"}]],"accountNonExpired":true,"accountNonLocked":true,"credentialsNonExpired":true,"enabled":true},"credentials":null}," org.springframework.security .oauth2.core.endpoint.OAuth2AuthorizationRequest":{"@class":" org.springframework.security .oauth2.core.endpoint.OAuth2AuthorizationRequest","authorizationUri":" http://localhost:9000/oauth2/authorize","authorizationGrantType":{"value":"authorization_code"},"responseType":{"value":"code"},"clientId":"messaging-client","redirectUri":"http://127.0.0.1:8080/login/oauth2/code/messaging-client-oidc","scopes":["java.util.Collections$UnmodifiableSet",["openid"]],"state":null,"additionalParameters":{"@class":"java.util.Collections$UnmodifiableMap","grant_type":"authorization_code"},"authorizationRequestUri":"http://localhost:9000/oauth2/authorize?response_type=code&client_id=messaging-client&scope=openid&redirect_uri=http://127.0.0.1:8080/login/oauth2/code/messaging-client-oidc&grant_type=authorization_code","attributes":{"@class":"java.util.Collections$UnmodifiableMap"} }}] to -4 at org.mariadb.jdbc.export.ExceptionFactory.createException( ExceptionFactory.java:282 ) ~[mariadb-java-client-3.0.10.jar:na] at org.mariadb.jdbc.export.ExceptionFactory.create( ExceptionFactory.java:336 ) ~[mariadb-java-client-3.0.10.jar:na] at org.mariadb.jdbc.BasePreparedStatement.setInternalObject( BasePreparedStatement.java:1172 ) ~[mariadb-java-client-3.0.10.jar:na] at org.mariadb.jdbc.BasePreparedStatement.setObject( BasePreparedStatement.java:608 ) ~[mariadb-java-client-3.0.10.jar:na] at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.setObject( HikariProxyPreparedStatement.java ) ~[HikariCP-5.0.1.jar:na] at org.springframework.jdbc.core.StatementCreatorUtils.setValue( StatementCreatorUtils.java:415 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal( StatementCreatorUtils.java:236 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.jdbc.core.StatementCreatorUtils.setParameterValue( StatementCreatorUtils.java:152 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.jdbc.core.ArgumentPreparedStatementSetter.doSetValue( ArgumentPreparedStatementSetter.java:65 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.security .oauth2.server.authorization.JdbcOAuth2AuthorizationService$LobCreatorArgumentPreparedStatementSetter.doSetValue( JdbcOAuth2AuthorizationService.java:621 ) ~[spring-security-oauth2-authorization-server-1.0.0.jar:1.0.0] at org.springframework.jdbc.core.ArgumentPreparedStatementSetter.setValues( ArgumentPreparedStatementSetter.java:50 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.jdbc.core.JdbcTemplate.lambda$update$2( JdbcTemplate.java:963 ) ~[spring-jdbc-6.0.4.jar:6.0.4] at org.springframework.jdbc.core.JdbcTemplate.execute( JdbcTemplate.java:651 ) ~[spring-jdbc-6.0.4.jar:6.0.4] ... 68 common frames omitted
미해결
블로그 자동화 프로그램 개발 강의 (파이썬 + 셀레니움)
강의에서 기능 구현을 빠르게 하기위해 브라우저 화면 로딩이 끝날 때까지 time.sleep 으로 코드 진행을 멈추도록 작성되어 있습니다. 강의 도중에 해당 부분을 다른 방법으로 변경한다고 언급했는데, 변경되지 않은 채로 강의가 종료되었습니다. 이 부분은 어떻게 개선될 수 있을까요? 일반적으로는 webdriver에서 제공하는 implicitly_wait을 이용하는 것으로 알고 있는데, 더 나은 방법이 있을까요?
해결됨
자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
안녕하세요. 질문이 있습니다, @Id @GeneratedValue(...) private Long id; 이렇게는 사용해봤는데 처음에 =null 을 사용하신 이유가 궁금합니다.
미해결
블로그 자동화 프로그램 개발 강의 (파이썬 + 셀레니움)
[이웃신청] 추출한 블로거의 계정에 이웃신청을 해봅시다 1 위 강의에서 서이추 화면 URL 에러가 왜 발생한건가요? 에러라고 말씀하신 URL로 GET을 날려봤는데, 크롬 웹 드라이버가 아무런 반응을 하지 않더라구요. 혹시 다른 사이트 자동화를 할 때, 어떻게 지금처럼 "URL 에러구나" 라고 판단할 수 있는지 궁금합니다. 그리고 이를 우회하기 위해서 모바일 페이지의 URL을 이용하신 것 같은데, 혹시 블로그에서 모바일 URL을 제공하지 않았다면 방법이 없었을까요?
해결됨
실습으로 끝장내는 웹 크롤링과 웹 페이지 자동화 & 실전 활용
크롤링 잘 배우고 있습니다. 추가 요청사항이 있는데요. 추출한 데이터를 판다스 데이터프레임으로 만들고 엑셀파일로 만드는 내용도 추가되면 다양하게 활용하는데 좋을 것 같습니다.
해결됨
실전! 스프링 부트와 JPA 활용2 - API 개발과 성능 최적화
우선 2개의 질문을 참고하였습니다. 이것과 이것입니다. 두개의 글을 종합해 보면, V1에서 Order리스트를 반환할때는 Lazy방식이기 때문에 Member객체가 프록시 객체이고, Jackson이 해당 해당 객체를 접근하는 순간 초기화한다는 것입니다. 그리고 해당 프록시 객체를 JSON으로 읽을수 있도록 도와주는 것이 하이버네이트5모듈이라는 것입니다. 여기서 궁금한 점이 //강제 지연 로딩 설정 hibernate5Module.configure(Hibernate5Module.Feature.FORCE_LAZY_LOADING, true); 이 코드입니다. 해당 코드는 강제 지연 로딩 설정이라고 하는데 강의 21분 20초경 LAZY를 강제 초기화 한다고 나와있습니다. 저는 위의 코드와 for (Order order : orders) { order.getMember().getName(); order.getDelivery().getAddress(); } 이 코드가 같은 역할을 한다고 이해했습니다. 위의 두개의 코드를 삭제하면, 포스트맨으로 요청을 보냈을 때, Member, orderItems, Delivery에는 null 값이 들어갑니다. 두개의 코드중 하나를 넣으면 요청을 넣었을때 Member, orderItems, Delivery에 실제 값이 들어가게 됩니다. 하지만 위의 두 글을 종합한 내용을 보면 Jackson이 해당 해당 객체를 접근하는 순간 초기화 라는 내용이 있습니다. 그렇다면 이미 초기화 된 프록시 객체일텐데 왜 위의 강제초기화 코드를 넣어야 실제 값이 들어가게 되는지 궁금합니다. jackson이 프록시 객체에 접근할때 초기화가 되어서 두 코드를 넣지 않아도 null이 아닌 실제 값이 나와야하는 것 아닌가요? 글이 너무 길어 죄송합니다..ㅠㅠ
미해결
자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
안녕하세요. 선생님 따라서 코딩중인데 구글링결과대로 시도해봐도 딱히 해결되지 않아서 질문 남겼습니다... 제목 그대로 import 자체가 되지 않아요 ㅠ
미해결
자바 ORM 표준 JPA 프로그래밍 - 기본편
<요구사항> 사용자가 맘에 드는 장소를 저장 할 수 있다. Place 에서 FavoritePlace 를 Join 하고 싶다. <관계도> Place(1) - (N)FavoritePlace(N) - (1)User <질문내용> Place 에는 FavoritePlace 필드가 없기 때문에 join 을 사용 할 수 가 없어서 , 양방향 매핑을 이용 하였습니다. 이럴 경우 양방향 매핑을 사용하는것이 맞는지 궁금하고, FavoirtePlace 의 상태가 변경될때의,연관관계 편의메서드를 구현하였는데 흐름은 Place 가 가지고 있는 list 를 순회하여, 바뀌기전의 FavoirtePlace 를 삭제하고 새로운 FavoirtePlace 를 add 하는 로직을 선택하였습니다. 그러다보니 수많은 List 중 FavoirtePlace 하나를 순회하여 찾아 제거 하는 작업이 조금 버거울거같다는 고민이 생겼습니다. 제가 이해한 양방향을 써야 하는 상황이 이부분이 맞는지, 위와 같은 상황에서 어떻게 해결하는게 조금 더 현명할지 조언 듣고 싶습니다! 감사합니다
미해결
파이썬 무료 강의 (활용편3) - 웹 스크래핑 (5시간)
네이버 IT 뉴스 링크를 그냥 크롬이나 사파리를 통해서 접속하면 정상적으로 잘 접속이 됩니다. 하지만 requests.get을 사용하면 에러가 발생해 파싱을 정상적으로 하기 힘든 상황입니다.ㅠ 셀레니움을 사용하던지 다른 뉴스 페이지를 사용해야할거같습니다. 저의 경우는 구글뉴스를 파싱 했습니다. 좋은 강의 해주셔서 감사합니다.! import re import requests from bs4 import BeautifulSoup weather_url = "https://search.naver.com/search.naver?sm=tab_hty.top&where=nexearch&query=%EC%84%9C%EC%9A%B8+%EB%82%A0%EC%94%A8&oquery=%EC%84%9C%EC%9A%B8+%EB%82%A0%EC%8B%9C&tqi=h%2B4nksprvTVssQv3%2BkdssssstAZ-264690" news_url = "https://www.google.com/search?q=%EA%B5%AC%EA%B8%80%EB%89%B4%EC%8A%A4&rlz=1C5CHFA_enKR979KR979&source=lnms&tbm=nws&sa=X&ved=2ahUKEwio8ZP_jIP9AhXnm1YBHfaRBAUQ_AUoAXoECAEQAw&biw=1057&bih=976&dpr=1" english_url = "https://www.hackers.co.kr/?c=s_eng/eng_contents/I_others_english&keywd=haceng_submain_lnb_eng_I_others_english&logger_kw=haceng_submain_lnb_eng_I_others_english" headers = { "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36", "Accept-Language":"ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7" } def create_soup(url): res = requests.get(url, headers=headers) res.raise_for_status() return BeautifulSoup(res.text, "lxml") def get_weather_info(): soup = create_soup(weather_url) current_temp = soup.find("div", attrs={"class": "temperature_text"}).get_text().strip().split()[-1][2:] compare = soup.find("p", attrs={"class": "summary"}).get_text() summary_list = soup.find("dl", attrs={"class": "summary_list"}).get_text().strip() dust = soup.find_all("li", attrs={"class": "item_today level1"})[0].get_text().strip() micro_dust = soup.find_all("li", attrs={"class": "item_today level1"})[1].get_text().strip() uv = soup.find("li", attrs={"class": "item_today level2"}).get_text().strip() sunset = soup.find("li", attrs={"class": "item_today type_sun"}).get_text().strip() rain_ratio = soup.find("li", attrs={"class": "week_item today"}).find_all("span", attrs={"class": "weather_left"}) rain_ratio_am = rain_ratio[0].get_text().strip() rain_ratio_pm = rain_ratio[1].get_text().strip() print("현재 기온 : {}".format(current_temp)) print(compare) print(summary_list) print("{} / {} / {} / {}".format(dust, micro_dust, uv, sunset)) print("강수 확률 : {} / {}\n".format(rain_ratio_am, rain_ratio_pm)) def get_news_headline(): soup = create_soup(news_url) headlines = soup.find_all("div", attrs={"class": "mCBkyc ynAwRc MBeuO nDgy9d"}, limit=6) urls = soup.find_all("a", attrs={"class": "WlydOe"}, limit=6) for idx, headline in enumerate(headlines): print(headline.get_text()) print(urls[idx]["href"] + "\n") def get_eng_sentence(): soup = create_soup(english_url) expression = soup.find_all("b", attrs={"class": "conv_txtTitle"}) sentences = soup.find_all("div", attrs={"id": re.compile("conv_kor_t\d*")}) print("\n< 오늘의 영어 회화 >") print("한글 표현") print("* " + expression[0].get_text()) for sentence in sentences[0:len(sentences)//2]: print(sentence.get_text().strip()) print("\n영어 표현") print("* " + expression[1].get_text()) for sentence in sentences[len(sentences) // 2:]: print(sentence.get_text().strip()) def main(): get_weather_info() get_news_headline() get_eng_sentence() if __name__ == "__main__": main()
미해결
파이썬 무료 강의 (활용편3) - 웹 스크래핑 (5시간)
23년 2월 7일 현재, 강의해주신 다음부동산의 화면이 상이해 네이버 부동산을 이용해서 비슷하게 따라해봤습니다. import requests from bs4 import BeautifulSoup url = "https://search.naver.com/search.naver?sm=tab_hty.top&where=nexearch&query=%EC%86%A1%ED%8C%8C+%ED%97%AC%EB%A6%AC%EC%98%A4%EC%8B%9C%ED%8B%B0+%EB%A7%A4%EB%AC%BC&oquery=%EC%86%A1%ED%8C%8C+%ED%97%AC%EB%A6%AC%EC%98%A4%EC%8B%9C%ED%8B%B0+%EB%A7%A4%EB%A7%A4&tqi=h%2B4thwprvmZss6uUL7ossssstOZ-299895" res = requests.get(url) res.raise_for_status() soup = BeautifulSoup(res.text, "lxml") houses = soup.find_all("tr", attrs={"class": {"_land_tr_row"}}) for num, house in enumerate(houses): info = house.get_text().split() print(f"=========={num+1}번 매물==========") print(f"매매 방식 : {info[0]}") print(f"매물 위치 : {info[1]}") print(f"매물 이름 : {info[2]}") print(f"동 : {info[3][:4]}") print(f"거래 부동산 : {info[3][4:]}") print(f"면적 : {info[4]}") print(f"가격 : {info[5]} 만원") print(f"층 : {info[-2]}")
미해결
자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
BookMemoryRepository랑 BookMysqlRepository에 @Repository를 모두 붙이면 빨간줄이 강의상에선 나는데 저는 이상이 없는 데 혹시 스프링 버전 차이인건지 궁금합니다.
해결됨
자바 ORM 표준 JPA 프로그래밍 - 기본편
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예) [질문 내용] Joincolumn의 name속성은 그저 member테이블의 조인컬럼의 컬럼명을 지정하는것뿐 team과 매핑하는것과는 관련이없다. member와 team을 연관관계맺는것은 referencedColumnName속성이 하지만 이것을 생략하면 자동으로 team의 pk값으로 연관관계를 맺어줘서 생략한다. 이게 맞을까요?
미해결
자바 개발자를 위한 코틀린 입문(Java to Kotlin Starter Guide)
안녕하세요, 주제와는 좀 다른 질문인데요. 강의하시는거 보면 맥에서 intelij 를 상당히 잘 활용하신다고 느꼈습니다. 특히, 9강에서 ide 화면을 4분할로 빠르게 구성하는게 인상적이었는데, 혹시 그 방법과 단축키 알려주실수 있나요?
미해결
스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
따라치기에 바쁘고 코드를 적으시는데 이해못하면 잘못 듣고있는건가요? 자바 강의는 다 들었는데 뭘하시는지를 모르겠고 따라적기만 하고있습니다..
해결됨
스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
해당 에러를 고치기 위해 세팅의 자바 컴파일러 버전을 11로 바꾸었는데 이렇게 진행하여도 괜찮은가요??
미해결
자바 ORM 표준 JPA 프로그래밍 - 기본편
Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Cannot drop "PRODUCT" because "FKR3MKF1FYVW50W5N52XQ1B8A4B" depends on it; SQL statement: 참조때문에 drop이 안되어서 create를 다시할떄 문제가 생기는 것같습니다.