Skip to content

Nested @AfterPageLoad not working #13

Description

@beothorn
@Page("http://hackaday.com/blog/")
public class Hackaday {

    @Page()
    public static class Post{
        @Selector(".entry-title") String title;
        @Selector(".entry-date") String dateAsString;
        Date date;

        @AfterPageLoad
        public void after() {
            final DateFormat format = new SimpleDateFormat("MMMMM d, yyyy", Locale.US);
            try {
                this.date = format.parse(this.dateAsString);
            } catch (final ParseException e) {
                throw new RuntimeException(e);
            }
        }
    }

    @Selector("article")
    public List<Post> posts;

    public static void main(final String[] args) {
        Browser
            .get(Hackaday.class)
            .posts
            .forEach(p ->  System.out.println(p.title+" : "+p.date));
    }

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions