Last active
August 5, 2024 07:22
-
-
Save JinKwonJeon/309a29d311bd057ec00358927e0f711e to your computer and use it in GitHub Desktop.
NaverShoppingCount 함수 (PowerQuery M)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (Keywords as text) => | |
| let | |
| // Step 1: 네이버 쇼핑 메인 페이지에서 키워드 검색 결과를 바이너리 형식으로 가져오기 | |
| NShoppingMain = Web.BrowserContents("https://search.shopping.naver.com/search/all?query="&Keywords), | |
| // Step 2: 'subFilters' 문자열의 위치 찾기 | |
| CatPos = Text.PositionOf(NShoppingMain, "subFilters"), | |
| // Step 3: 'subFilters' 이후의 텍스트 가져오기 | |
| TextAfterMainFilter = Text.Middle(NShoppingMain, CatPos, Text.Length(NShoppingMain) - CatPos), | |
| // Step 4: 'productCount":' 문자열의 위치 찾기 | |
| CountPos = Text.PositionOf(TextAfterMainFilter, "productCount"":"), | |
| // Step 5: 'productCount":' 이후의 텍스트 가져오기 | |
| TextAfterCount = Text.Middle(TextAfterMainFilter, CountPos, Text.Length(TextAfterMainFilter) - CountPos), | |
| // Step 6: '},' 문자열의 위치 찾기 | |
| CommaPos = Text.PositionOf(TextAfterCount, "},"), | |
| // Step 7: 'productCount' 값을 숫자 형식으로 변환 | |
| NaverShoppingCount = Number.From(Text.Middle(TextAfterCount, 14, CommaPos - 14)) | |
| in | |
| NaverShoppingCount |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
2024-08-05 / WebBrowserContents 함수로 웹 데이터 호출 방식 변경