haha
This commit is contained in:
42
1.py
42
1.py
@@ -126,26 +126,27 @@ def _greet_one_geek(page, container, item):
|
|||||||
if not name_ele:
|
if not name_ele:
|
||||||
print(f" 跳过未找到:{geekName}")
|
print(f" 跳过未找到:{geekName}")
|
||||||
return False
|
return False
|
||||||
name_ele.run_js("this.scrollIntoView({block: 'center', behavior: 'auto'})")
|
|
||||||
time.sleep(0.6)
|
name_ele.run_js("this.scrollIntoView()")
|
||||||
parent = name_ele.parent()
|
name_ele.click()
|
||||||
greet_btn = None
|
time.sleep(3)
|
||||||
for _ in range(8):
|
a = page.get_frame(1)
|
||||||
if not parent:
|
|
||||||
break
|
|
||||||
greet_btn = parent.ele('x://span[text()="打招呼"]', timeout=0.5) or parent.ele(
|
|
||||||
'x://*[contains(text(),"打招呼")]', timeout=0.5)
|
|
||||||
if greet_btn:
|
|
||||||
break
|
|
||||||
parent = parent.parent()
|
|
||||||
if not greet_btn:
|
|
||||||
greet_btn = container.ele('x://span[text()="打招呼"]', timeout=2) or container.ele(
|
|
||||||
'x://*[contains(text(),"打招呼")]', timeout=1)
|
|
||||||
if not greet_btn:
|
|
||||||
print(f" 未找到「打招呼」按钮:{geekName}")
|
|
||||||
return False
|
|
||||||
greet_btn.click(by_js=True)
|
|
||||||
time.sleep(random.uniform(0.5, 1.2))
|
time.sleep(random.uniform(0.5, 1.2))
|
||||||
|
a.ele(f'x://*[contains(text(),"打招呼")]', timeout=2).click(by_js=True)
|
||||||
|
time.sleep(random.uniform(0.5, 1.2))
|
||||||
|
a.ele(f'x://*[contains(text(),"收藏")]', timeout=2).click(by_js=True)
|
||||||
|
time.sleep(random.uniform(0.5, 1.2))
|
||||||
|
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))
|
||||||
|
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))
|
||||||
|
page.ele('x://*[@class="iboss iboss-close"]').click()
|
||||||
|
time.sleep(random.uniform(0.5, 1.2))
|
||||||
|
a.ele('x://*[@class="boss-popup__close"]').click()
|
||||||
|
time.sleep(random.uniform(0.5, 1.2))
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@@ -241,7 +242,8 @@ def main(filters, position_names=None, greet_target=None):
|
|||||||
total_greeted += n
|
total_greeted += n
|
||||||
round_added += n
|
round_added += n
|
||||||
if n:
|
if n:
|
||||||
print(f"岗位「{label}」本包 {len(geek_list)} 人,新打招呼 {n} 人,累计 {total_greeted}" + (f"/{greet_target}" if greet_target else ""))
|
print(f"岗位「{label}」本包 {len(geek_list)} 人,新打招呼 {n} 人,累计 {total_greeted}" + (
|
||||||
|
f"/{greet_target}" if greet_target else ""))
|
||||||
|
|
||||||
if greet_target is None:
|
if greet_target is None:
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user