Hacker News new | past | comments | ask | show | jobs | submit login

I'm not clear on what the scope of selenium is or how it works, but for a general web scraper, I'd identify some targets I want out of skyscanner. Here's a quick googletest butchery for "I want to make sure my function returns flights for a known good flight search."

    TEST(SkyScanner, ListFlights)
    {
        flights = MyFlightScrapingFunction(LAX, AMS, date+1 month, 1 way, 1 adult)
        EXPECT_THAT(flights, SizeIs( Gt(0) )

        EXPECT_THAT(flights, Each( AllOf( 
                                       Field(&Flight::from, Eq(LAX)), 
                                       Field(&Flight::to, Eq(AMS)),
                                       Field(&Flight::seats, Eq(1)) 
                                         )))
    }
I feel that anything simpler ("is this possible with selenium?") is a documentation moment.



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: