These are chat archives for ui4j/ui4j

Jul 2015
Ozhan Duz
Jul 21 2015 16:40
@rpeterson03 You could use Element.getCss(String) to find all links that have background-image css style

Sample code: ```package com.ui4j.sample;

import java.util.List;

import com.ui4j.api.browser.BrowserEngine;
import com.ui4j.api.browser.BrowserFactory;
import com.ui4j.api.browser.Page;
import com.ui4j.api.dom.Document;
import com.ui4j.api.dom.Element;

public class Sample {

public static void main(String[] args) {
    BrowserEngine webkit = BrowserFactory.getWebKit();
    Page page = webkit.navigate("");

    Document document = page.getDocument();
    List<Element> links = document.queryAll("a");

    List<Element> linksWithBackgroundImage = links
                                                .filter(e -> e.getCss("background-image").isPresent())

    linksWithBackgroundImage.forEach(e -> { System.out.println(e.getCss("background-image").get()); });