Skip to content

Instantly share code, notes, and snippets.

@mukeshtiwari
Created January 7, 2016 10:25
Show Gist options
  • Save mukeshtiwari/59bbfe0ab81b7f3439d2 to your computer and use it in GitHub Desktop.
Save mukeshtiwari/59bbfe0ab81b7f3439d2 to your computer and use it in GitHub Desktop.
Tripadvisor url
;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