From 5711edf5fec249223f81d4136eb6376ecd871f6c Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 6 Mar 2026 14:28:30 +0800 Subject: [PATCH] haah --- 1.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/1.py b/1.py index cb3d197..e51d1e8 100644 --- a/1.py +++ b/1.py @@ -19,7 +19,7 @@ if str(_ROOT) not in sys.path: sys.path.insert(0, str(_ROOT)) # ---------- 选择控制对象 ---------- -USE_LOCAL_CHROME = True # True=本地谷歌 Chrome,False=比特浏览器 +USE_LOCAL_CHROME = False # True=本地谷歌 Chrome,False=比特浏览器 # 本地谷歌 Chrome 配置(仅当 USE_LOCAL_CHROME=True 时生效) CHROME_DEBUG_PORT = 9222 # 调试端口;若为 None 则由脚本自动启动 Chrome @@ -27,7 +27,7 @@ CHROME_PATH = None # 例如 r"C:\Program Files\Google\Chrome\Application\chrome # 比特浏览器配置(仅当 USE_LOCAL_CHROME=False 时生效) BIT_API_BASE = "http://127.0.0.1:54345" -BROWSER_NAME = "测试2" +BROWSER_NAME = "测试1" BROWSER_ID = None @@ -139,21 +139,22 @@ def _greet_one_geek(page, container, item): name_ele.click() time.sleep(3) a = page.get_frame(1) - time.sleep(random.uniform(0.5, 1.2)) + time.sleep(random.uniform(0.5, 5)) a.ele(f'x://*[contains(text(),"打招呼")]', timeout=2).click(by_js=True) - time.sleep(random.uniform(0.5, 1.2)) + time.sleep(random.uniform(0.5, 5)) a.ele(f'x://*[contains(text(),"收藏")]', timeout=2).click(by_js=True) - time.sleep(random.uniform(0.5, 1.2)) + time.sleep(random.uniform(0.5, 5)) for i in range(3): - a.ele(f'x://*[@class="btn-v2 btn-outline-v2"]', timeout=2).click(by_js=True) - time.sleep(random.uniform(0.5, 1.2)) + a.ele('x://*[@class="btn-v2 btn-outline-v2"]').click(by_js=True) + # a.ele(f'x://*[contains(text(),"继续沟通")]', timeout=2).click(by_js=True) + time.sleep(random.uniform(0.5, 5)) page.ele(f'x://*[@data-placeholder="快速回复"]', timeout=2).input("我司正在招聘爬虫工程师,有兴趣了解一下吗") page.ele(f'x://*[contains(text(),"发送")]', timeout=2).click() - time.sleep(random.uniform(0.5, 1.2)) + time.sleep(random.uniform(0.5, 5)) page.ele('x://*[@class="iboss iboss-close"]').click() - time.sleep(random.uniform(0.5, 1.2)) + time.sleep(random.uniform(0.5, 5)) a.ele('x://*[@class="boss-popup__close"]').click() - time.sleep(random.uniform(0.5, 1.2)) + time.sleep(random.uniform(0.5, 5)) return True @@ -369,6 +370,6 @@ def main1( if __name__ == "__main__": # greet_target=50:所有岗位合计打招呼 50 人;一轮不够则从第一个岗位再跑,直到够了或一轮无新增 - main(filters=["初中及以下", "离职-随时到岗"], greet_target=50) - main1() + main(filters=["初中及以下", "离职-随时到岗"], greet_target=35) + # main1() # main2()