3 ms·
Ok, so let's say you were experimenting with the selenium library to see if you could scrape what comes out of skyscanner. What steps would you take?
by crdoconnor 11y ago
Ok, so let's say you were experimenting with the selenium library to see if you could scrape what comes out of skyscanner.
What steps would you take?
- lfowles 11y agoI'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.