コード例 #1
0
                                ],
                                frame=[0])
                            rpa_c7ad3a.switch_to_frame_by_path([0])
                            rpa_6f20db_string = rpa_c7ad3a.get_element(
                                "rpa_c42e4a", timeout=30).text()
                            sleep(0)

                        except Exception as e:
                            log.error("[%s] %s", "获取标题内容", e.message)
                            raise e

                        # -*- 打印日志
                        try:
                            from rpa import log

                            log.info("[%s] %s", "打印日志", rpa_6f20db_string)

                        except Exception as e:
                            log.error("[%s] %s", "打印日志", e.message)
                            raise e

                        # -*- 获取Table1
                        try:
                            from time import sleep

                            sleep(0)
                            rpa_c7ad3a.add_element(
                                "rpa_856f3f",
                                id="",
                                css="",
                                xpath=[
コード例 #2
0
ファイル: test_2.py プロジェクト: woobrain/some_test
                        ],
                        frame=[])
                    rpa_4d2c6a_webpage.switch_to_frame_by_path([])
                    rpa_d5ac1e_boolean = rpa_4d2c6a_webpage.get_element(
                        "rpa_168acb", timeout=30).is_visible()
                    sleep(0)

                except Exception as e:
                    log.error("[%s] %s", "判断网页元素状态", e.message)
                    raise e

                # -*- 打印日志1
                try:
                    from rpa import log

                    log.info("[%s] %s", "打印日志1", rpa_d5ac1e_boolean)

                except Exception as e:
                    log.error("[%s] %s", "打印日志1", e.message)
                    raise e

                # -*- 条件判断
                try:

                    if rpa_d5ac1e_boolean == a:

                        # -*- 退出循环
                        try:
                            break

                        except Exception as e:
コード例 #3
0
ファイル: zifu.py プロジェクト: woobrain/some_test
    rpa_d6cca0_webelement = rpa_2ab734_webpage.get_element(element_name="rpa_a36988", index=0, timeout=30)
    sleep(0)

except Exception as e:
    visual_block.Visual_Block_Info("获取对号", 18, 2, e)

    log.error("[%s] %s", "获取对号", e.message)
    raise e

# -*- 打印日志
try:
    visual_block.Visual_Block_Info("打印日志", 19, 0, "正在执行")

    from rpa import log

    log.info("[%s] %s", "打印日志", rpa_d6cca0_webelement)

except Exception as e:
    visual_block.Visual_Block_Info("打印日志", 19, 2, e)

    log.error("[%s] %s", "打印日志", e.message)
    raise e

# -*- 退出程序
try:
    visual_block.Visual_Block_Info("退出程序", 20, 0, "正在执行")

    exit(0)

except Exception as e:
    visual_block.Visual_Block_Info("退出程序", 20, 2, e)
コード例 #4
0
ファイル: zimu.py プロジェクト: woobrain/some_test
                            log.error("[%s] %s", "得到file_name1", str(e))
                            raise e

                        # -*- 拼接文件名1
                        try:
                            rpa_2bd1e0 = file_name + ".pdf"

                        except Exception as e:
                            log.error("[%s] %s", "拼接文件名1", str(e))
                            raise e

                        # -*- 打印日志21
                        try:
                            from rpa import log

                            log.info("[%s] %s", "打印日志21", rpa_e5514d)

                        except Exception as e:
                            log.error("[%s] %s", "打印日志21", str(e))
                            raise e

                        # -*- 获取标题网址1
                        try:
                            from time import sleep

                            sleep(0)
                            rpa_fcda63_webpage.switch_to_frame_by_path(
                                rpa_68937f.frame)
                            rpa_8d6105 = rpa_68937f.get_attr("href")
                            sleep(0)
コード例 #5
0
ファイル: new_zixun.py プロジェクト: woobrain/some_test
                                            #     writer.writerow([title_str,html_str,content_str,p_date,source_str,cmy_str])
                                            tmp_dict = dict(title=title_str, content_html=html_str, content=content_str,
                                                            publishdate=time.mktime(p_date.timetuple()),
                                                            source=source_str, company=cmy_str, summary=None, tags=None)
                                            redis_cli.rpush("automatic_news", json.dumps(tmp_dict))

                                        except Exception as e:
                                            log.error("[%s] %s", "写入redis", str(e))
                                            raise e
                                    except Exception as e:

                                        # -*- 打印日志1
                                        try:
                                            from rpa import log

                                            log.info("[%s] %s", "打印日志1", href_str)

                                        except Exception as e:
                                            log.error("[%s] %s", "打印日志1", str(e))
                                            raise e

                                        # -*- 退出循环2
                                        try:
                                            continue

                                        except Exception as e:
                                            log.error("[%s] %s", "退出循环2", str(e))
                                            raise e
                                    finally:
                                        pass
コード例 #6
0
ファイル: b_test.py プロジェクト: woobrain/some_test
                xpath=["//div/span", "//span[contains(.,'抽取列表')]"],
                frame=[])
            rpa_2ab734_webpage.switch_to_frame_by_path([])
            rpa_a11a19_boolean = rpa_2ab734_webpage.get_element(
                "rpa_de5ba5", timeout=30).is_visible()
            sleep(0)

        except Exception as e:
            log.error("[%s] %s", "判断网页元素状态", e.message)
            raise e

        # -*- 打印日志
        try:
            from rpa import log

            log.info("[%s] %s", "打印日志", rpa_a11a19_boolean)

        except Exception as e:
            log.error("[%s] %s", "打印日志", e.message)
            raise e

        # -*- 条件判断
        try:

            if rpa_a11a19_boolean == bool_a:

                # -*- 退出循环
                try:
                    break

                except Exception as e:
コード例 #7
0
ファイル: a_test.py プロジェクト: woobrain/some_test
                        ],
                        frame=[])
                    rpa_0d164f_webpage.switch_to_frame_by_path([])
                    rpa_cb1a9b_webelement = rpa_0d164f_webpage.get_element(
                        element_name="rpa_1167b1", index=0, timeout=30)
                    sleep(0)

                except Exception as e:
                    log.error("[%s] %s", "获取网页元素2", str(e))
                    raise e

                # -*- 打印日志1
                try:
                    from rpa import log

                    log.info("[%s] %s", "打印日志1", "")

                except Exception as e:
                    log.error("[%s] %s", "打印日志1", str(e))
                    raise e

                # -*- 获取网页元素3
                try:
                    from time import sleep

                    sleep(0)
                    rpa_cb1a9b_webelement.switch_to_frame()
                    rpa_35b5c7_webelement = rpa_cb1a9b_webelement.children(
                        index=0)
                    sleep(0)