File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed
src/main/java/ru/mystamps/web/feature/series/importing/extractor Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -232,11 +232,7 @@ protected String extractCountry(Element body) {
232
232
}
233
233
234
234
protected String extractImageUrl (Element body ) {
235
- if (imageUrlLocator == null ) {
236
- return null ;
237
- }
238
-
239
- Element elem = body .selectFirst (imageUrlLocator );
235
+ Element elem = getFirstElement (body , imageUrlLocator );
240
236
if (elem == null ) {
241
237
return null ;
242
238
}
@@ -302,11 +298,7 @@ protected String extractSellerName(Element body) {
302
298
}
303
299
304
300
protected String extractSellerUrl (Element body ) {
305
- if (sellerLocator == null ) {
306
- return null ;
307
- }
308
-
309
- Element elem = body .selectFirst (sellerLocator );
301
+ Element elem = getFirstElement (body , sellerLocator );
310
302
if (elem == null ) {
311
303
return null ;
312
304
}
@@ -335,12 +327,16 @@ protected String extractCurrency(Element body) {
335
327
return currencyValue ;
336
328
}
337
329
338
- private static String getTextOfTheFirstElement (Element body , String locator ) {
330
+ private static Element getFirstElement (Element body , String locator ) {
339
331
if (locator == null ) {
340
332
return null ;
341
333
}
342
334
343
- Element elem = body .selectFirst (locator );
335
+ return body .selectFirst (locator );
336
+ }
337
+
338
+ private static String getTextOfTheFirstElement (Element body , String locator ) {
339
+ Element elem = getFirstElement (body , locator );
344
340
if (elem == null ) {
345
341
return null ;
346
342
}
You can’t perform that action at this time.
0 commit comments