Hi,
First off, thank you for all of your support, metulburr and snippsat.
I solved how to scrape the page by using their APIs. I learned I should send a certain type of header in order to make use of their APIs such as an approved client id and key.
My next mission will be how to collect names and print in excel or notepad. I will ask you more questions!
I'm sharing a sample code for using their APIs:
First off, thank you for all of your support, metulburr and snippsat.
I solved how to scrape the page by using their APIs. I learned I should send a certain type of header in order to make use of their APIs such as an approved client id and key.
My next mission will be how to collect names and print in excel or notepad. I will ask you more questions!
I'm sharing a sample code for using their APIs:
import os import sys import urllib.request client_id = "YOUR_CLIENT_ID" client_secret = "YOUR_CLIENT_SECRET" encText = urllib.parse.quote("검색할 단어") url = "https://openapi.naver.com/v1/search/blog?query=" + encText # json 결과 # url = "https://openapi.naver.com/v1/search/blog.xml?query=" + encText # xml 결과 request = urllib.request.Request(url) request.add_header("X-Naver-Client-Id",client_id) request.add_header("X-Naver-Client-Secret",client_secret) response = urllib.request.urlopen(request) rescode = response.getcode() if(rescode==200): response_body = response.read() print(response_body.decode('utf-8')) else: print("Error Code:" + rescode)P.S. Could you please recommend a well-received Python editor? I'm using Geany and having trouble when I copy and paste the result of my code because it is shown on Windows Command. So I have to type out all the characters.