-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathZUtils.py
34 lines (25 loc) · 915 Bytes
/
ZUtils.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import MyUtils
import time
import multiprocessing
from selenium.webdriver.common.by import By
from retrying import retry
# @retry(retry_on_exception=MyUtils.retry)
@MyUtils.consume
# 展开回答
def spanAnswer(l):
page = l[0]
# 展开
# MyUtils.MyClick([page,By.XPATH,'/html/body/div[1]/div/main/div/div[1]/div[2]/div[2]/div[1]/div/div/div/div[2]/div[1]/button'])
MyUtils.clickelement([page, By.XPATH, '/html/body/div[1]/div/main/div/div[1]/div[2]/div[2]/div[1]/div/div/div/div[2]/span/div/button'])
time.sleep(2)
def answerpicture(l):
page = l[0]
eles = MyUtils.elements([page, By.XPATH, '/html/body/div[1]/div/main/div/div[1]/div[2]/div[2]/div[1]/div[1]/div/div/div/div[2]/div[1]/div[1]/div/div/span/img'])
# 获取url
url = []
for ele in eles:
url.append(ele.get_attribute('data-original'))
def main():
pass
if __name__ == '__main__':
main()