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
@nnnlog
Copy link

nnnlog commented Oct 3, 2019

https://github.com/Kamilla1004/BandArticleRemover/blob/master/BandArticleRemover.py

다른 사람이 복붙해서 올렸는데 따로 조치가 필요하지는 않을까요?

@mjy9088
Copy link
Author

mjy9088 commented Oct 3, 2019

https://github.com/Kamilla1004/BandArticleRemover/blob/master/BandArticleRemover.py

다른 사람이 복붙해서 올렸는데 따로 조치가 필요하지는 않을까요?

헉 출처도 안 밝히고 그냥 올리시다니ㅠㅜ // 알려주셔서 감사합니다!

https://github.com/Kamilla1004/BandArticleRemover/issues/1 태클거는 건 아니지만 일단 이슈 올렸어요!

@nnnlog
Copy link

nnnlog commented Oct 3, 2019

https://github.com/Kamilla1004/BandArticleRemover/blob/master/BandArticleRemover.py
다른 사람이 복붙해서 올렸는데 따로 조치가 필요하지는 않을까요?

헉 출처도 안 밝히고 그냥 올리시다니ㅠㅜ // 알려주셔서 감사합니다!

Kamilla1004/BandArticleRemover#1 일단 이슈 올렸어요!

따로 주영님께서 Repo를 파서 올리시는게 더 나을 것 같기도 하네요..

@kalijin
Copy link

kalijin commented Mar 27, 2020

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

@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