4 ms·
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 quic
by lfowles 11y ago
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.