from selenium import webdriver
from selenium.webdriver import ActionChains
import time
dr = webdriver.Chrome()
dr.get('http://www.ylq.com/neidi/yangmi/')
time.sleep(0.5)
js='''
var result=[];
var li= $(".hd.starRelation").find("li");
$.each(li,function(j,i){
var rel=$(i).find("em").text();
var starName=$(i).find("p").text();
result.push(starName+"_"+rel);
})
return result.join(",");
'''
value2 =dr.execute_script(js)
print(value2)
手机扫一扫
移动阅读更方便
你可能感兴趣的文章