python – 从Selenium的url下载CSV?

我有一个我想定期下载的URL.它只能从需要
javascript支持的登录帐户访问,所以我被迫使用Selenium和PhantomJS,相信我.否则,我会使用urllib,但它给我一个错误的迹象.

它是一个CSV文件,最多1000行,大约6列.

我想最终将此CSV列入列表.有谁知道如何使用Selenium Webdriver下载CSV?

非常感谢.

编辑:我只是想从Selenium的URL下载CSV.没有其他的.

最佳答案 它实际上非常简单.使用另一个答案,我在堆栈中给出了流量

https://stackoverflow.com/a/21871600/2423379

编辑:在无头模式下运行Firefox

要求:

> sudo apt-get install xvfb(或ur发行版中的等效命令)
> pip install –user xvfbwrapper

和代码部分

from xvfbwrapper import Xvfb

vdisplay = Xvfb()
vdisplay.start()

# launch stuff inside virtual display here

vdisplay.stop()

参考:Firefox-selenium in headless mode

点赞