Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions download.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from util.download_wait import wait_download
from util.robust import robust

import time

@robust
def click_po(po):
Expand All @@ -26,9 +27,12 @@ def download_page(driver):
driver.execute_script('arguments[0].click();', download_button)

# 60 프레임, without skin 을 선택합니다.
select_elements = driver.find_elements(By.CSS_SELECTOR, 'select#formControlsSelect')
Select(select_elements[1]).select_by_value('false')
Select(select_elements[2]).select_by_value('60')
try:
select_elements = driver.find_elements(By.CSS_SELECTOR, 'select#formControlsSelect')
Select(select_elements[1]).select_by_value('false')
# Select(select_elements[2]).select_by_value('60')
except:
pass

# 팝업에 뜬 Download 버튼을 선택합니다.
inner_download_button = WebDriverWait(driver, 10).until(
Expand All @@ -38,11 +42,11 @@ def download_page(driver):
driver.execute_script('arguments[0].click();', inner_download_button)

# 다운로드가 시작될 때 까지 기다립니다.
WebDriverWait(driver, 30).until(
WebDriverWait(driver, 240).until(
EC.element_to_be_clickable((By.CSS_SELECTOR,
"li.message-display-item.alert.alert-dismissible.alert-info"))
)

# if i != 0 and i % 5 == 0: # 매 5번째 다운로드 마다 다운로드 완료를 기다립니다... 가 원래 계획이었으나 다운로드 페이지를 못 불러오네요
# pass
# driver.implicitly_wait(120) # 그래서 그냥 2 분 기다립니다.
Expand All @@ -53,7 +57,7 @@ def download_page(driver):
def download(driver, page):
driver.get('https://www.mixamo.com/#/?page={}'.format(page))
driver.implicitly_wait(3)
time.sleep(10)
download_page(driver)



9 changes: 5 additions & 4 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
from download import download
from login import login
from util.download_wait import wait_download
import time

opts = webdriver.ChromeOptions()
opts.add_experimental_option("detach", True)
driver = webdriver.Chrome(DRIVER_PATH, chrome_options=opts)

login(driver)
download(driver, 4) # 다운로드할 페이지를 선택합니다.



for i in range(1, 52):
print ('page', i)
time.sleep(10)
download(driver, i) # 다운로드할 페이지를 선택합니다.