标签:path edr drive int 输出 class UI chrome logs
python3.6、selenium、chromedriver
先上代码
from selenium import webdriver from time import sleep driver=webdriver.Chrome() driver.get(‘https://www.douyu.com/xiao8‘) #此处写斗鱼url danmukuid = 0 while(1): danmakus = driver.find_elements_by_xpath(‘//*[@id="js-chat-cont"]/div[3]/ul/li‘) # print(‘danmakus:‘+str(danmakus)) danmakusize = len(danmakus) # print(‘danmakusize:‘ + str(danmakusize)) sleep(1) for i in range(danmukuid,danmakusize): print(str(i)+danmakus[i].text) danmukuid = danmukuid +1
能简单的输出一下弹幕,没有入库只是放在了屏幕上,效果如下
标签:path edr drive int 输出 class UI chrome logs
原文地址:http://www.cnblogs.com/Jacck/p/7815774.html