def ur():
uu =[]
for p in a:
browser.get(p)
time.sleep(5)
html = browser.page_source
html = bs(html,'lxml')
cont = html.findAll('h3')
for i in cont:
x = i.a
pan = 'pic_studing' in str(x)
pan2 = 'anniu_01a.gif' in str(x)
if pan:
u ='http://cme2.91huayi.com'+x.attrs['href'][2:]
print(i.text)
print(u)
uu.append(u)
elif pan2:
u ='http://cme2.91huayi.com'+x.attrs['href'][2:]
print(i.text)
print(u)
uu.append(u)
return uu
#考试函数
def jian():
try:
try:
browser.find_element_by_xpath('//*[@id="jrks"]').click()
time.sleep(5)
except:
pass
html = browser.page_source
if '完成认证即可进入考试' in html:
return 1
else:
pass
pan = '在线考试' in html
if pan:
x =1
try:
for e in range(5):
while True:
pan =cha(5)
break
if pan==True:
break
except:
pass
else:
x=0
except:
x = 0
return x
21年广东公需课 科技创新现状与发展趋势自动学习python 代码
最新推荐文章于 2023-11-27 22:23:53 发布