Last active
July 3, 2020 07:43
-
-
Save mjy9088/5dd44c6e120b0604f5170b8ce398c0c7 to your computer and use it in GitHub Desktop.
네이버 밴드 글 삭제 매크로?
This file contains 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
# -*- 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 |
안녕하세요. 검색해서 들어왔는데 이것 자체를 사용하려면 어떻게 해야하나요? 코딩을 아에 몰라서 어떤 프로그램을 사용해야지 쓸 수 있는지 알려주시면 감사드립니다 ㅠㅠ
파이썬이랑 Selenium 받으시고 그냥 실행하시면 돼요. 어디서 막히시나요¿
제가 코딩을 헬로월드밖에 안해봐서 ㅋㅋ...알려주셔서 감사합니다! 막히는 부분생기면 여쭤봐도 될까요?
제가 코딩을 헬로월드밖에 안해봐서 ㅋㅋ...알려주셔서 감사합니다! 막히는 부분생기면 여쭤봐도 될까요?
물론이죠 아마도 답변 안 해 드릴 거라 부담없이 물어보셔도 됩니다 :D
아 넵ㅋ 수고링~
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
안녕하세요. 검색해서 들어왔는데 이것 자체를 사용하려면 어떻게 해야하나요? 코딩을 아에 몰라서 어떤 프로그램을 사용해야지 쓸 수 있는지 알려주시면 감사드립니다 ㅠㅠ