使用Selenium和Firefox无界面模式后台爬取新浪新闻“疫情”实时数据以及制作docker镜像
为了实时获取新浪新闻网页的实时数据,采用selenium爬虫方法;为了在没有图形界面系统而无法弹窗如服务器上运行,可以使用firefox或chrome的headless模式,而PhantomJS已经不被selenium支持了。直接上代码:#!/usr/bin/env pythonimport timefrom selenium import web-driverfrom selenium.webdriver.firefox.options import Optionsoptions = O





