Skip to content

Commit 49d6101

Browse files
committed
remove repartition
1 parent 95f8dab commit 49d6101

File tree

1 file changed

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

1 file changed

+13
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ public void filterResponse(HttpResponse response, HttpMessageContents contents,
138138
final ChromeOptions chromeOptions = new ChromeOptions();
139139
chromeOptions.addArguments("--no-sandbox");
140140
chromeOptions.addArguments("--headless");
141+
chromeOptions.addArguments("--proxy-server='direct://'");
142+
chromeOptions.addArguments("--proxy-bypass-list=*");
143+
chromeOptions.addArguments("--blink-settings=imagesEnabled=false");
141144
chromeOptions.addArguments("--disable-gpu");
142145
chromeOptions.addArguments("--disable-extensions");
143146
chromeOptions.addArguments("--ignore-certificate-errors");
@@ -195,7 +198,12 @@ public FetchedData fetch(Resource resource) throws Exception {
195198
System.out.println("failed to start selenium session");
196199
}
197200
driver.get(resource.getUrl());
198-
201+
if(resource.getUrl().contains("cms.gov")){
202+
Cookie ck = new Cookie("mcdReportTourFinished", "true");
203+
driver.manage().addCookie(ck);
204+
driver.get(resource.getUrl());
205+
//driver.navigate().refresh();
206+
}
199207
int waittimeout = (int) pluginConfig.getOrDefault("chrome.wait.timeout", "-1");
200208
String waittype = (String) pluginConfig.getOrDefault("chrome.wait.type", "");
201209
String waitelement = (String) pluginConfig.getOrDefault("chrome.wait.element", "");
@@ -217,6 +225,10 @@ public FetchedData fetch(Resource resource) throws Exception {
217225
LOG.debug("waiting for id...");
218226
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id(waitelement)));
219227
break;
228+
case "xpath":
229+
LOG.debug("waiting for xpath...");
230+
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(waitelement)));
231+
break;
220232
}
221233
}
222234
SeleniumScripter scripter = new SeleniumScripter(driver);

0 commit comments

Comments
 (0)