티스토리 뷰

 

    naverOpenAPI0 = 'https://openapi.naver.com/v1/search/shop.json'
    param1 = {
        'query': keyWord,
        'display': displayNumber,
        'start': startIndex,
        'sort': 'date' # sim(ilarity), asc(price ascending), dsc(price descending)
    }
    headerParams = {"X-Naver-Client-Id":clientID, "X-Naver-Client-Secret":clientSecret}
    if param1: 
        res1 = requests.get(naverOpenAPI0, headers=headerParams, params=param1)
    else: 
        address1 = naverOpenAPI0 + '?query='+keyWord+'장식조명&display=100&start='+str(startIndex)
        res1 = requests.get(naverOpenAPI, headers=headerParams)
    print(res1.text)
    res2 = json.loads(res1.text)
    items2 = res2['items']
    for item21 in items2:
        print(item21['title'])
        imageURL = item21['image']
        linkAddress = item21['link']
        lPrice = item21['lprice']
        hPrice = item21['hprice']
        productID = item21['productId']
        productType = item21['productType']
        brand = item21['brand']
        maker = item21['maker']
        category1 = item21['category1']
        category2 = item21['category2']
        category3 = item21['category3']
        category4 = item21['category4']

 

반응형

'SWDesk' 카테고리의 다른 글

Goorm-IDE Background Operation  (0) 2021.05.31
[Python] 유사 문장 찾아서 제거하기  (0) 2021.05.21
Naver OpenAPI - 통합 검색어 트렌드  (0) 2021.05.04
[Python] Webdriver - scroll 예제  (2) 2021.05.04
Kakao Push Alarm  (0) 2021.05.04
반응형
250x250
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/01   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함