擅长:python、mysql、java
<p>好吧,我放弃了<code>Geckodriver</code>,我用<code>PhantomJS</code>作为我的网络驱动程序。在</p>
<pre><code> from selenium import webdriver
display = Display(visible=0, size=(800, 600))
display.start()
driver = webdriver.PhantomJS()
driver.get('http://www.python.org')
html_source = driver.page_source
print ("html_source:",html_source)
driver.quit()
</code></pre>
<p>以下是我用于安装PhantomJS的步骤:</p>
^{pr2}$
<p>另请参见<a href="https://gist.github.com/julionc/7476620" rel="nofollow noreferrer">How to install PhantomJS on Ubuntu</a>。在</p>