def baiud_get():
while not q.empty():
bd=q.get()
req=requests.get(bd,headers=headers)
time.sleep(4)
baidu=req.text
html=etree.HTML(baidu)
ul=html.xpath('//h3[@class="c-title t t tts-title"]')
for uls in ul:
t=uls.xpath('./a[1]')
for tt in t:
ttt=tt.xpath('@href')
r=requests.get(ttt[0])
print(r.url)
def scan():
while not q.empty():
dir=q.get()
urls=url+dir
urls=urls.replace("\n",'')
code=requests.get(urls).status_code
if code==200 or code==403:
f=open("yes.txt","a+")
f.write(urls)
f.close
else:
print(urls+'|'+str(code))
time.sleep(1)