Skip to content

Instantly share code, notes, and snippets.

@mjy9088
Last active July 3, 2020 07:43
Show Gist options
  • Save mjy9088/5dd44c6e120b0604f5170b8ce398c0c7 to your computer and use it in GitHub Desktop.
Save mjy9088/5dd44c6e120b0604f5170b8ce398c0c7 to your computer and use it in GitHub Desktop.
네이버 밴드 글 삭제 매크로?
# -*- encoding: utf-8 -*-
import selenium
from selenium import webdriver
from time import sleep
driver = webdriver.Chrome('(웹드라이버 경로)')
driver.implicitly_wait(3)
driver.get('https://band.us/band/(밴드 ID)')
input("로그인 한 다음에 엔터를 눌러주세요.")
cnt = 0
while(True):
try:
sleep(0.05)
elem = driver.find_element_by_xpath("//button[@class='postSet _btnPostMore']")
elem.click()
sleep(0.05)
driver.find_element_by_xpath("//ul[@class='_postMoreMenuUl']/li[last()]").click()
sleep(0.05)
driver.find_element_by_xpath("//button[@class='uButton -confirm _btnConfirm']").click()
print("삭제 완료");
except:
cnt += 1
if cnt > 10:
cnt = 0
print("오류 발생?")
try:
driver.execute_script("window.scrollTo(0, 0)")
except:
pass
sleep(1)
try:
driver.execute_script("window.scrollTo(0, document.body.scrollHeight)")
except:
pass
@mjy9088
Copy link
Author

mjy9088 commented Mar 28, 2020

이거 어떻게사용하는건가요?

시작하면 크롬이 열리는데, 로그인 후에 엔터 치시면 됩니다.

전에 잠깐 쓰려고 만들었다가 신경을 안 쓰고 있어서 지금도 작동할지는 잘 모르겠네요

@Lion0411
Copy link

Lion0411 commented Jul 1, 2020

안녕하세요. 검색해서 들어왔는데 이것 자체를 사용하려면 어떻게 해야하나요? 코딩을 아에 몰라서 어떤 프로그램을 사용해야지 쓸 수 있는지 알려주시면 감사드립니다 ㅠㅠ

@mjy9088
Copy link
Author

mjy9088 commented Jul 1, 2020

안녕하세요. 검색해서 들어왔는데 이것 자체를 사용하려면 어떻게 해야하나요? 코딩을 아에 몰라서 어떤 프로그램을 사용해야지 쓸 수 있는지 알려주시면 감사드립니다 ㅠㅠ

파이썬이랑 Selenium 받으시고 그냥 실행하시면 돼요. 어디서 막히시나요¿

@Lion0411
Copy link

Lion0411 commented Jul 2, 2020

제가 코딩을 헬로월드밖에 안해봐서 ㅋㅋ...알려주셔서 감사합니다! 막히는 부분생기면 여쭤봐도 될까요?

@mjy9088
Copy link
Author

mjy9088 commented Jul 3, 2020

제가 코딩을 헬로월드밖에 안해봐서 ㅋㅋ...알려주셔서 감사합니다! 막히는 부분생기면 여쭤봐도 될까요?

물론이죠 아마도 답변 안 해 드릴 거라 부담없이 물어보셔도 됩니다 :D

@Lion0411
Copy link

Lion0411 commented Jul 3, 2020

아 넵ㅋ 수고링~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment