修复seleniumDownloader配置文件写死的问题 #475
parent
d87c73b472
commit
895fca9fd7
|
@ -13,7 +13,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.seleniumhq.selenium</groupId>
|
<groupId>org.seleniumhq.selenium</groupId>
|
||||||
<artifactId>selenium-java</artifactId>
|
<artifactId>selenium-java</artifactId>
|
||||||
<version>2.46.0</version>
|
<version>2.41.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>us.codecraft</groupId>
|
<groupId>us.codecraft</groupId>
|
||||||
|
|
|
@ -45,7 +45,7 @@ class WebDriverPool {
|
||||||
private WebDriver mDriver = null;
|
private WebDriver mDriver = null;
|
||||||
private boolean mAutoQuitDriver = true;
|
private boolean mAutoQuitDriver = true;
|
||||||
|
|
||||||
private static final String CONFIG_FILE = "/Users/Bingo/Documents/workspace/webmagic/webmagic-selenium/config.ini";
|
private static final String DEFAULT_CONFIG_FILE = "/data/webmagic/webmagic-selenium/config.ini";
|
||||||
private static final String DRIVER_FIREFOX = "firefox";
|
private static final String DRIVER_FIREFOX = "firefox";
|
||||||
private static final String DRIVER_CHROME = "chrome";
|
private static final String DRIVER_CHROME = "chrome";
|
||||||
private static final String DRIVER_PHANTOMJS = "phantomjs";
|
private static final String DRIVER_PHANTOMJS = "phantomjs";
|
||||||
|
@ -64,7 +64,11 @@ class WebDriverPool {
|
||||||
public void configure() throws IOException {
|
public void configure() throws IOException {
|
||||||
// Read config file
|
// Read config file
|
||||||
sConfig = new Properties();
|
sConfig = new Properties();
|
||||||
sConfig.load(new FileReader(CONFIG_FILE));
|
String configFile = DEFAULT_CONFIG_FILE;
|
||||||
|
if (System.getProperty("selenuim_config")!=null){
|
||||||
|
configFile = System.getProperty("selenuim_config");
|
||||||
|
}
|
||||||
|
sConfig.load(new FileReader(configFile));
|
||||||
|
|
||||||
// Prepare capabilities
|
// Prepare capabilities
|
||||||
sCaps = new DesiredCapabilities();
|
sCaps = new DesiredCapabilities();
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
#driver=phantomjs
|
||||||
|
driver=firefox
|
||||||
|
driver=chrome
|
||||||
|
#driver=http://localhost:8910
|
||||||
|
driver=http://localhost:4444/wd/hub
|
||||||
|
|
||||||
|
# PhantomJS specific config (change according to your installation)
|
||||||
|
#phantomjs_exec_path=/Users/detro/bin/phantomjs-qt5
|
||||||
|
phantomjs_exec_path=/Users/detro/bin/phantomjs-upstream
|
||||||
|
phantomjs_driver_path=../../src/main.js
|
||||||
|
phantomjs_driver_loglevel=DEBUG
|
Loading…
Reference in New Issue