Skip to content

Commit 7ecffc2

Browse files
committed
force new selenium session
1 parent 5266893 commit 7ecffc2

File tree

1 file changed

+4
-0
lines changed
  • sparkler-core/sparkler-plugins/fetcher-chrome/src/main/java/edu/usc/irds/sparkler/plugin

1 file changed

+4
-0
lines changed

sparkler-core/sparkler-plugins/fetcher-chrome/src/main/java/edu/usc/irds/sparkler/plugin/FetcherChrome.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ public void filterResponse(HttpResponse response, HttpMessageContents contents,
144144
chromeOptions.addArguments("--disable-gpu");
145145
chromeOptions.addArguments("--disable-extensions");
146146
chromeOptions.addArguments("--ignore-certificate-errors");
147+
chromeOptions.addArguments("--incognito");
147148
capabilities.setCapability(CapabilityType.PROXY, seleniumProxy);
148149
capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
149150

@@ -157,6 +158,7 @@ public void filterResponse(HttpResponse response, HttpMessageContents contents,
157158
}
158159
@Override
159160
public FetchedData fetch(Resource resource) throws Exception {
161+
startDriver(false);
160162
LOG.info("Chrome FETCHER {}", resource.getUrl());
161163
FetchedData fetchedData;
162164
JSONObject json = null;
@@ -248,6 +250,8 @@ public FetchedData fetch(Resource resource) throws Exception {
248250
fetchedData = new FetchedData(html.getBytes(), "text/html", latestStatus);
249251
resource.setStatus(ResourceStatus.FETCHED.toString());
250252
fetchedData.setResource(resource);
253+
driver.quit();
254+
driver = null;
251255
return fetchedData;
252256
}
253257

0 commit comments

Comments
 (0)