class Public_Add_Quiz: def __init__(self, driver): self.chrome = driver self.driver_func = Driver_Action(driver) self.admin_xpath_list_func = Admin_Menu_Path() self.basic_func = Basic() # 管理画面のメニューのパスを返す self.admin_xpath_lists_xpath = self.admin_xpath_list_func.get_admin_menu_xpath( ) # 管理画面メニュー内の新規追加や編集などのパーツのパスを返す。 self.admin_list_parts_xpath = self.admin_xpath_list_func.get_admin_menu_list_parts_xpath( ) # 管理画面内の項目に関するパス(作成した固定ページリストとか) self.admin_parts_xpath = self.admin_xpath_list_func.get_admin_parts() #ユーザー画面内の項目に関するパス self.public_parts_xpath = self.admin_xpath_list_func.get_public_parts() self.base_dir = self.basic_func.get_base_dir_path() def go_to_lesson_list_page(self): self.driver_func.go_to_public_nav_menu('動画一覧ページ') def go_to_element_lesson_list_page(self): all_lesson_list = self.public_parts_xpath['all_lesson_list_xpath'] all_lesson_list_link = self.public_parts_xpath[ 'all_lesson_list_link_xpath'] target_lesson_lists = {'英語初級講座', '英語中級講座', '英語上級講座'} for target_lesson_text in target_lesson_lists: all_lesson_lists_link_elem = self.driver_func.get_elements_by_xpath( all_lesson_list_link) all_lesson_lists_elem = self.driver_func.get_elements_by_xpath( all_lesson_list) #概要ページから該当する名前順にリンクの要素を取得 link_elem = self.basic_func.get_target_link_element( all_lesson_lists_elem, all_lesson_lists_link_elem, target_lesson_text) #リンクを取得 lesson_detail_link = self.driver_func.get_link(link_elem) #リンクに飛ぶ self.driver_func.move_to_page_by_link(self.chrome, lesson_detail_link) self.driver_func.scroll_down(self.chrome) self.driver_func.scroll_top(self.chrome) self.go_to_first_lesson() def go_to_first_lesson(self): first_lesson_link = self.public_parts_xpath['first_lesson_link_xpath'] #概要ページのすべてのレッスンを取得する first_lesson_elem = self.driver_func.get_elements_by_xpath( first_lesson_link) lesson_comp_btn = self.public_parts_xpath['lesson_comp_btn_xpath'] try: lesson_elem = self.driver_func.get_elements_by_xpath( '//div[@id="lesson-list-box"]/div[@class="lesson-list-detail-box lesson-bg-lock"]' ) except Exception as e: lesson_count = len(first_lesson_elem) else: lesson_count = len(first_lesson_elem) + len(lesson_elem) #最初のレッスンをクリックする。 self.driver_func.click_item(first_lesson_elem[0]) self.driver_func.stop(1) for x in range(lesson_count): try: lesson_comp_btn_elem = self.driver_func.get_element_by_xpath( lesson_comp_btn) self.driver_func.click_item(lesson_comp_btn_elem) except Exception as e: self.progress_quiz() else: self.progress_btn() self.go_to_lesson_list_page() #通常のボタンクリックで、次のページへ進むタイプ def progress_btn(self): lesson_next_btn = self.public_parts_xpath['lesson_next_btn_xpath'] #次のページへ進むが最後のページにはないので、それをチェックする。 try: lesson_next_btn_elem = self.driver_func.get_element_by_xpath( lesson_next_btn) self.driver_func.click_item(lesson_next_btn_elem) self.driver_func.stop(1) except NoSuchElementException: pass #クイズに答える形式で、次のページへ進むタイプ def progress_quiz(self): lesson_quiz_lists_xpath = self.public_parts_xpath[ 'lesson_quiz_lists_xpath'] send_answer_xpath = self.public_parts_xpath['send_answer_xpath'] next_btn_xpath = self.public_parts_xpath['next_btn_xpath'] lesson_quiz_lists_elem = self.driver_func.get_elements_by_xpath( lesson_quiz_lists_xpath) send_answer_elem = self.driver_func.get_element_by_xpath( send_answer_xpath) for x in range(0, len(lesson_quiz_lists_elem)): self.driver_func.click_item(lesson_quiz_lists_elem[x]) self.driver_func.click_item(send_answer_elem) self.driver_func.stop(1) #正解して、次へ進むボタンが表示されるまでループを繰り返す。 try: next_btn_elem = self.driver_func.get_element_by_xpath( next_btn_xpath) self.driver_func.click_item(next_btn_elem) except Exception as e: pass else: break """
class Public_Lesson_Lock: def __init__(self, driver): self.chrome = driver self.driver_func = Driver_Action(driver) self.admin_xpath_list_func = Admin_Menu_Path() self.basic_func = Basic() # 管理画面のメニューのパスを返す self.admin_xpath_lists_xpath = self.admin_xpath_list_func.get_admin_menu_xpath( ) # 管理画面メニュー内の新規追加や編集などのパーツのパスを返す。 self.admin_list_parts_xpath = self.admin_xpath_list_func.get_admin_menu_list_parts_xpath( ) # 管理画面内の項目に関するパス(作成した固定ページリストとか) self.admin_parts_xpath = self.admin_xpath_list_func.get_admin_parts() #ユーザー画面内の項目に関するパス self.public_parts_xpath = self.admin_xpath_list_func.get_public_parts() self.base_dir = self.basic_func.get_base_dir_path() def check_element_page(self): self.go_to_element_lesson_list_page() all_lesson_title_list_xpath = self.public_parts_xpath[ 'all_lesson_title_list_xpath'] lesson_detail_link = self.public_parts_xpath['lesson_detail_lists'] block_page_list = ['英語リスニング(初級講座)', '英語スピーキング(初級講座)'] for block_page_text in block_page_list: lesson_detail_elem = self.driver_func.get_elements_by_xpath( lesson_detail_link) all_lesson_title_lists_elem = self.driver_func.get_elements_by_xpath( all_lesson_title_list_xpath) lesson_detail_page_link = self.basic_func.get_target_link_element( all_lesson_title_lists_elem, lesson_detail_elem, block_page_text) self.driver_func.click_item(lesson_detail_page_link) self.driver_func.stop(2) self.go_to_lesson_list_page() self.go_to_element_lesson_list_page() def go_to_lesson_list_page(self): self.driver_func.go_to_public_nav_menu('動画一覧ページ') def go_to_element_lesson_list_page(self): all_lesson_list = self.public_parts_xpath['all_lesson_list_xpath'] all_lesson_list_link = self.public_parts_xpath[ 'all_lesson_list_link_xpath'] target_lesson_lists = {'英語初級講座', '英語中級講座', '英語上級講座'} for target_lesson_text in target_lesson_lists: all_lesson_lists_link_elem = self.driver_func.get_elements_by_xpath( all_lesson_list_link) all_lesson_lists_elem = self.driver_func.get_elements_by_xpath( all_lesson_list) #概要ページから該当する名前順にリンクの要素を取得 link_elem = self.basic_func.get_target_link_element( all_lesson_lists_elem, all_lesson_lists_link_elem, target_lesson_text) #リンクを取得 lesson_detail_link = self.driver_func.get_link(link_elem) #リンクに飛ぶ self.driver_func.move_to_page_by_link(self.chrome, lesson_detail_link) self.driver_func.scroll_down(self.chrome) self.driver_func.scroll_top(self.chrome) self.go_to_first_lesson() def go_to_first_lesson(self): first_lesson_link = self.public_parts_xpath['first_lesson_link_xpath'] #概要ページのすべてのレッスンを取得する first_lesson_elem = self.driver_func.get_elements_by_xpath( first_lesson_link) lesson_comp_btn = self.public_parts_xpath['lesson_comp_btn_xpath'] lesson_next_btn = self.public_parts_xpath['lesson_next_btn_xpath'] try: lesson_elem = self.driver_func.get_elements_by_xpath( '//div[@id="lesson-list-box"]/div[@class="lesson-list-detail-box lesson-bg-lock"]' ) except Exception as e: lesson_count = len(first_lesson_elem) else: lesson_count = len(first_lesson_elem) + len(lesson_elem) #最初のレッスンをクリックする。 self.driver_func.click_item(first_lesson_elem[0]) self.driver_func.stop(1) #レッスンの総数分だけ、レッスン完了をクリックして、レッスンを完了していく。 for i in range(lesson_count): lesson_comp_btn_elem = self.driver_func.get_element_by_xpath( lesson_comp_btn) self.driver_func.click_item(lesson_comp_btn_elem) #次のページへ進むが最後のページにはないので、それをチェックする。 try: lesson_next_btn_elem = self.driver_func.get_element_by_xpath( lesson_next_btn) self.driver_func.click_item(lesson_next_btn_elem) except NoSuchElementException: pass self.go_to_lesson_list_page()
class Admin_Add_Quiz: def __init__(self, driver): self.chrome = driver self.driver_func = Driver_Action(driver) self.admin_xpath_list_func = Admin_Menu_Path() self.basic_func = Basic() # 管理画面のメニューのパスを返す self.admin_xpath_lists_xpath = self.admin_xpath_list_func.get_admin_menu_xpath( ) # 管理画面メニュー内の新規追加や編集などのパーツのパスを返す。 self.admin_list_parts_xpath = self.admin_xpath_list_func.get_admin_menu_list_parts_xpath( ) # 管理画面内の項目に関するパス(作成した固定ページリストとか) self.admin_parts_xpath = self.admin_xpath_list_func.get_admin_parts() #ユーザー画面内の項目に関するパス self.public_parts_xpath = self.admin_xpath_list_func.get_public_parts() self.base_dir = self.basic_func.get_base_dir_path() def set_quiz_to_page(self): lesson_details = { 'beginner_lesson_details': { 'first_lesson_details': { 'post_title': '英語文法(初級講座)', 'page_lock': '1', 'quiz_num': 6, 'quiz_correct_num': 5, 'quiz_text': self.base_dir + '/assets/texts/quiz/quiz.txt', 'first_quiz_answer': 'answer_1', 'quiz_answer': { 'answer_2', 'answer_3', 'answer_4', 'answer_5', 'answer_6', } }, 'second_lesson_details': { 'post_title': '英語リスニング(初級講座)', 'page_lock': '2', 'quiz_num': 2, 'quiz_correct_num': 2, 'quiz_text': self.base_dir + '/assets/texts/quiz/quiz.txt', 'first_quiz_answer': 'answer_1', 'quiz_answer': { 'answer_2', } }, 'third_lesson_details': { 'post_title': '英語リーディング(初級講座)', 'page_lock': '2', 'quiz_num': 1, 'quiz_correct_num': 1, 'quiz_text': self.base_dir + '/assets/texts/quiz/quiz.txt', 'first_quiz_answer': 'answer_1', 'quiz_answer': {} }, 'fourth_lesson_details': { 'post_title': '英語スピーキング(初級講座)', 'page_lock': '2', 'quiz_num': 4, 'quiz_correct_num': 2, 'quiz_text': self.base_dir + '/assets/texts/quiz/quiz.txt', 'first_quiz_answer': 'answer_1', 'quiz_answer': { 'answer_2', 'answer_3', 'answer_4', } }, 'fifth_lesson_details': { 'post_title': '英語単語(初級講座)', 'page_lock': '2', 'quiz_num': 4, 'quiz_correct_num': 3, 'quiz_text': self.base_dir + '/assets/texts/quiz/quiz.txt', 'first_quiz_answer': 'answer_1', 'quiz_answer': { 'answer_2', 'answer_3', 'answer_4', } } }, 'normal_lesson_details': { 'first_lesson_details': { 'post_title': '英語文法(中級講座)', 'page_lock': '1', 'quiz_num': 2, 'quiz_correct_num': 1, 'quiz_text': self.base_dir + '/assets/texts/quiz/quiz.txt', 'first_quiz_answer': 'answer_1', 'quiz_answer': { 'answer_2', } }, 'second_lesson_details': { 'post_title': '英語リスニング(中級講座)', 'page_lock': '2', 'quiz_num': 1, 'quiz_correct_num': 1, 'quiz_text': self.base_dir + '/assets/texts/quiz/quiz.txt', 'first_quiz_answer': 'answer_1', 'quiz_answer': {} }, 'third_lesson_details': { 'post_title': '英語リーディング(中級講座)', 'page_lock': '2', 'quiz_num': 7, 'quiz_correct_num': 5, 'quiz_text': self.base_dir + '/assets/texts/quiz/quiz.txt', 'first_quiz_answer': 'answer_1', 'quiz_answer': { 'answer_2', 'answer_3', 'answer_4', 'answer_5', 'answer_6', 'answer_7', } }, 'fourth_lesson_details': { 'post_title': '英語スピーキング(中級講座)', 'page_lock': '2', 'quiz_num': 6, 'quiz_correct_num': 5, 'quiz_text': self.base_dir + '/assets/texts/quiz/quiz.txt', 'first_quiz_answer': 'answer_1', 'quiz_answer': { 'answer_2', 'answer_3', 'answer_4', 'answer_5', 'answer_6', } }, 'fifth_lesson_details': { 'post_title': '英語単語(中級講座)', 'page_lock': '2', 'quiz_num': 9, 'quiz_correct_num': 8, 'quiz_text': self.base_dir + '/assets/texts/quiz/quiz.txt', 'first_quiz_answer': 'answer_1', 'quiz_answer': { 'answer_2', 'answer_3', 'answer_4', 'answer_5', 'answer_6', 'answer_7', 'answer_8', 'answer_9', } } }, 'advanced_lesson_details': { 'first_lesson_details': { 'post_title': '英語文法(上級講座)', 'page_lock': '1', 'quiz_num': 4, 'quiz_correct_num': 3, 'quiz_text': self.base_dir + '/assets/texts/quiz/quiz.txt', 'first_quiz_answer': 'answer_1', 'quiz_answer': { 'answer_2', 'answer_3', 'answer_4', } }, 'second_lesson_details': { 'post_title': '英語リスニング(上級講座)', 'page_lock': '2', 'quiz_num': 5, 'quiz_correct_num': 1, 'quiz_text': self.base_dir + '/assets/texts/quiz/quiz.txt', 'first_quiz_answer': 'answer_1', 'quiz_answer': { 'answer_2', 'answer_3', 'answer_4', 'answer_5', } }, 'third_lesson_details': { 'post_title': '英語リーディング(上級講座)', 'page_lock': '2', 'quiz_num': 1, 'quiz_correct_num': 1, 'quiz_text': self.base_dir + '/assets/texts/quiz/quiz.txt', 'first_quiz_answer': 'answer_1', 'quiz_answer': {} }, 'fourth_lesson_details': { 'post_title': '英語スピーキング(上級講座)', 'page_lock': '2', 'quiz_num': 5, 'quiz_correct_num': 3, 'quiz_text': self.base_dir + '/assets/texts/quiz/quiz.txt', 'first_quiz_answer': 'answer_1', 'quiz_answer': { 'answer_2', 'answer_3', 'answer_4', 'answer_5', } }, 'fifth_lesson_details': { 'post_title': '英語単語(上級講座)', 'page_lock': '2', 'quiz_num': 5, 'quiz_correct_num': 4, 'quiz_text': self.base_dir + '/assets/texts/quiz/quiz.txt', 'first_quiz_answer': 'answer_1', 'quiz_answer': { 'answer_2', 'answer_3', 'answer_4', 'answer_5', } } } } lesson_details_test = { 'beginner_lesson_details': { 'second_lesson_details': { 'post_title': '英語単語(上級講座)', 'page_lock': '2', 'quiz_num': 5, 'quiz_correct_num': 4, 'quiz_text': self.base_dir + '/assets/texts/quiz/quiz.txt', 'first_quiz_answer': 'answer_1', 'quiz_answer': { 'answer_2', 'answer_3', 'answer_4', 'answer_5', } } } } page_list_xpath = self.admin_parts_xpath['page_list_xpath'] page_list_elem = self.driver_func.get_elements_by_xpath( page_list_xpath) for details_item_name, details_item_value in lesson_details.items(): for list_name, lesson_details_lists in details_item_value.items(): self.add_info(lesson_details_lists) def reset_info(self, lesson_details_lists): page_list_xpath = self.admin_parts_xpath['page_list_xpath'] page_list_elem = self.driver_func.get_elements_by_xpath( page_list_xpath) no_quiz_btn_xpath = self.admin_parts_xpath['no_quiz_btn_xpath'] quiz_textarea_xpath = self.admin_parts_xpath['quiz_textarea_xpath'] quiz_input_xpath = self.admin_parts_xpath['quiz_input_xpath'] add_quiz_btn_xpath = self.admin_parts_xpath['add_quiz_btn_xpath'] quiz_first_input_xpath = self.admin_parts_xpath[ 'quiz_first_input_xpath'] answer_radio_xpath = self.admin_parts_xpath['answer_radio_xpath'] first_answer_radio_xpath = self.admin_parts_xpath[ 'first_answer_radio_xpath'] current_page_btn_xpath = self.admin_parts_xpath[ 'current_page_btn_xpath'] update_post_btn_xpath = self.admin_parts_xpath['update_post_btn'] target_text = lesson_details_lists['post_title'] target_elem = self.basic_func.get_target_element( page_list_elem, target_text) self.driver_func.click_item(target_elem) if (lesson_details_lists['page_lock'] == '2'): self.driver_func.stop(1) guild_press_quiz_btn_elem = self.driver_func.get_element_by_xpath( no_quiz_btn_xpath) self.driver_func.click_item(guild_press_quiz_btn_elem) self.driver_func.scroll_top(self.chrome) update_post_btn_elem = self.driver_func.get_element_by_xpath( update_post_btn_xpath) self.driver_func.click_item(update_post_btn_elem) self.driver_func.stop(1) #投稿リストを表示する current_page_btn_elem = self.driver_func.get_element_by_xpath( current_page_btn_xpath) self.driver_func.click_item(current_page_btn_elem) def add_info(self, lesson_details_lists): page_list_xpath = self.admin_parts_xpath['page_list_xpath'] page_list_elem = self.driver_func.get_elements_by_xpath( page_list_xpath) quiz_btn_xpath = self.admin_parts_xpath['quiz_btn_xpath'] quiz_textarea_xpath = self.admin_parts_xpath['quiz_textarea_xpath'] quiz_input_xpath = self.admin_parts_xpath['quiz_input_xpath'] add_quiz_btn_xpath = self.admin_parts_xpath['add_quiz_btn_xpath'] quiz_first_input_xpath = self.admin_parts_xpath[ 'quiz_first_input_xpath'] answer_radio_xpath = self.admin_parts_xpath['answer_radio_xpath'] first_answer_radio_xpath = self.admin_parts_xpath[ 'first_answer_radio_xpath'] current_page_btn_xpath = self.admin_parts_xpath[ 'current_page_btn_xpath'] update_post_btn_xpath = self.admin_parts_xpath['update_post_btn'] target_text = lesson_details_lists['post_title'] target_elem = self.basic_func.get_target_element( page_list_elem, target_text) self.driver_func.click_item(target_elem) if (lesson_details_lists['page_lock'] == '2'): self.driver_func.scroll_down(self.chrome) guild_press_quiz_btn_elem = self.driver_func.get_element_by_xpath( quiz_btn_xpath) self.driver_func.click_item(guild_press_quiz_btn_elem) for x in range(len(lesson_details_lists['quiz_answer'])): add_quiz_btn_elem = self.driver_func.get_element_by_xpath( add_quiz_btn_xpath) self.driver_func.click_item(add_quiz_btn_elem) guild_press_quiz_textarea_elem = self.driver_func.get_element_by_xpath( quiz_textarea_xpath) content_text = self.basic_func.get_file_text( lesson_details_lists['quiz_text']) self.driver_func.put_item_info(guild_press_quiz_textarea_elem, content_text) quiz_input_elem = self.driver_func.get_elements_by_xpath( quiz_input_xpath) quiz_first_input_elem = self.driver_func.get_element_by_xpath( quiz_first_input_xpath) self.driver_func.put_item_info( quiz_first_input_elem, lesson_details_lists['first_quiz_answer']) first_answer_radio_elem = self.driver_func.get_element_by_xpath( first_answer_radio_xpath) answer_radio_elem = self.driver_func.get_elements_by_xpath( answer_radio_xpath) self.driver_func.click_item(first_answer_radio_elem) for i, (quiz_inputs_elem, quiz_answer) in enumerate( zip(quiz_input_elem, lesson_details_lists['quiz_answer'])): if ((i + 1) == lesson_details_lists['quiz_correct_num']): self.driver_func.click_item(answer_radio_elem[i]) self.driver_func.put_item_info(quiz_inputs_elem, quiz_answer) self.driver_func.scroll_top(self.chrome) update_post_btn_elem = self.driver_func.get_element_by_xpath( update_post_btn_xpath) self.driver_func.click_item(update_post_btn_elem) self.driver_func.stop(1) #投稿リストを表示する current_page_btn_elem = self.driver_func.get_element_by_xpath( current_page_btn_xpath) self.driver_func.click_item(current_page_btn_elem)
class Admin_Lesson_Lock: def __init__(self, driver): self.chrome = driver self.driver_func = Driver_Action( driver ) self.admin_xpath_list_func = Admin_Menu_Path() self.basic_func = Basic() # 管理画面のメニューのパスを返す self.admin_xpath_lists_xpath = self.admin_xpath_list_func.get_admin_menu_xpath() # 管理画面メニュー内の新規追加や編集などのパーツのパスを返す。 self.admin_list_parts_xpath = self.admin_xpath_list_func.get_admin_menu_list_parts_xpath() # 管理画面内の項目に関するパス(作成した固定ページリストとか) self.admin_parts_xpath = self.admin_xpath_list_func.get_admin_parts() #ユーザー画面内の項目に関するパス self.public_parts_xpath = self.admin_xpath_list_func.get_public_parts() self.base_dir = self.basic_func.get_base_dir_path() def set_block_page( self ): lesson_details = { 'beginner_lesson_details' : { 'first_lesson_details' : { 'post_title' : '英語文法(初級講座)', 'page_lock' : '1', }, 'second_lesson_details' : { 'post_title' : '英語リスニング(初級講座)', 'page_lock' : '2', }, 'third_lesson_details' : { 'post_title' : '英語リーディング(初級講座)', 'page_lock' : '2', }, 'fourth_lesson_details' : { 'post_title' : '英語スピーキング(初級講座)', 'page_lock' : '2', }, 'fifth_lesson_details' : { 'post_title' : '英語単語(初級講座)', 'page_lock' : '2', } }, 'normal_lesson_details' : { 'first_lesson_details' : { 'post_title' : '英語文法(中級講座)', 'page_lock' : '1', }, 'second_lesson_details' : { 'post_title' : '英語リスニング(中級講座)', 'page_lock' : '1', }, 'third_lesson_details' : { 'post_title' : '英語リーディング(中級講座)', 'page_lock' : '2', }, 'fourth_lesson_details' : { 'post_title' : '英語スピーキング(中級講座)', 'page_lock' : '2', }, 'fifth_lesson_details' : { 'post_title' : '英語単語(中級講座)', 'page_lock' : '1', } }, 'advanced_lesson_details' : { 'first_lesson_details' : { 'post_title' : '英語文法(上級講座)', 'page_lock' : '1', }, 'second_lesson_details' : { 'post_title' : '英語リスニング(上級講座)', 'page_lock' : '2', }, 'third_lesson_details' : { 'post_title' : '英語リーディング(上級講座)', 'page_lock' : '1', }, 'fourth_lesson_details' : { 'post_title' : '英語スピーキング(上級講座)', 'page_lock' : '1', }, 'fifth_lesson_details' : { 'post_title' : '英語単語(上級講座)', 'page_lock' : '1', } } } lesson_details_test = { 'beginner_lesson_details' : { 'second_lesson_details' : { 'post_title' : '英語リスニング(初級講座)', 'page_lock' : '2', } } } page_list_xpath = self.admin_parts_xpath['page_list_xpath'] page_list_elem = self.driver_func.get_elements_by_xpath( page_list_xpath ) for details_item_name, details_item_value in lesson_details.items(): for list_name,lesson_details_lists in details_item_value.items(): self.add_info( lesson_details_lists ) def add_info( self, lesson_details_lists ): page_list_xpath = self.admin_parts_xpath['page_list_xpath'] page_list_elem = self.driver_func.get_elements_by_xpath( page_list_xpath ) page_lock_radio_xpath = self.admin_parts_xpath['page_lock_radio_xpath'] current_page_btn_xpath = self.admin_parts_xpath['current_page_btn_xpath'] update_post_btn_xpath = self.admin_parts_xpath['update_post_btn'] target_text = lesson_details_lists['post_title'] target_elem = self.basic_func.get_target_element( page_list_elem, target_text ) self.driver_func.click_item( target_elem ) if( lesson_details_lists['page_lock'] == '2' ): self.driver_func.scroll_down( self.chrome ) guild_press_lock_page_elem = self.driver_func.get_element_by_xpath( page_lock_radio_xpath ) self.driver_func.click_item( guild_press_lock_page_elem ) self.driver_func.scroll_top( self.chrome ) update_post_btn_elem = self.driver_func.get_element_by_xpath( update_post_btn_xpath ) self.driver_func.click_item( update_post_btn_elem ) self.driver_func.stop( 1 ) #投稿リストを表示する current_page_btn_elem = self.driver_func.get_element_by_xpath( current_page_btn_xpath ) self.driver_func.click_item( current_page_btn_elem )