Created
January 7, 2016 10:25
-
-
Save mukeshtiwari/59bbfe0ab81b7f3439d2 to your computer and use it in GitHub Desktop.
Tripadvisor url
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;some thing went wrong with my firefox update | |
(defn go-to-tripadv | |
"returns tripadvisors urls for city" | |
[city] | |
(do | |
(set-driver! {:browser :firefox}) | |
(get-url "https://www.tripadvisor.in") | |
(wait-until #(= (title) "TripAdvisor: Read Reviews, Compare Prices & Book")) | |
(input-text "#GEO_SCOPED_SEARCH_INPUT" city) | |
(click "#GEO_SCOPE_CONTAINER .scopedSearchDisplay li") | |
(apply quick-fill-submit | |
[{"#mainSearch" "Hotel"} | |
{"#SEARCH_BUTTON" click}]) | |
(wait-until | |
#(not= (title) "TripAdvisor: Read Reviews, Compare Prices & Book")) | |
(let [home-url (current-url) | |
page (page-source) | |
rest-url (fetch-all-nav-urls page)] | |
(quit) | |
(cons home-url rest-url)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment