Last active
June 3, 2018 13:56
-
-
Save rizkyramadhan21/235396a2f062d8420cb19bf36b6d33b4 to your computer and use it in GitHub Desktop.
Python script untuk backup XML postingan Blogger (Blogspot) | wadagizig.com
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
#-*- coding: utf-8 -*- | |
#------------------------------------------------ | |
#!/usr/bin/python | |
#------------------------------------------------ | |
def backupBlogger(): | |
from selenium import webdriver | |
import time | |
browser = webdriver.Chrome() | |
alamatURL = 'https://mail.google.com/mail/' | |
alamatBlog = 'https://www.blogger.com/blogger.g?blogID=0000000000000000000#othersettings' | |
browser.get(alamatURL) | |
# Username Google: | |
browser.find_element_by_id("identifierId").send_keys("username") | |
browser.find_element_by_id("identifierNext").click() | |
time.sleep(5) | |
# Password: | |
browser.find_element_by_css_selector('#password > div.aCsJod.oJeWuf > div > div.Xb9hP > input').send_keys("password") | |
browser.find_element_by_id("passwordNext").click() | |
time.sleep(5) | |
browser.get(alamatBlog) | |
time.sleep(5) | |
browser.find_element_by_css_selector('#blogger-app > div.K3JSBVB-e-h > div.K3JSBVB-e-e > div > div.K3JSBVB-i-x > div.K3JSBVB-i-m > div.K3JSBVB-i-l > div.otherSettings > div > div:nth-child(1) > table > tbody > tr:nth-child(1) > td.K3JSBVB-J-wb > button:nth-child(2)').click() | |
time.sleep(2) | |
browser.find_element_by_css_selector('#blogger-app > div.blogg-dialog > div > div > div.K3JSBVB-l-l > div > div > div.K3JSBVB-l-i > div.K3JSBVB-l-e > button').click() | |
time.sleep(20) | |
browser.quit() | |
backupBlogger() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment