How to use Ruby to clean up, create a session, and run a page on a target site

I am wondering how to use Ruby to clean a website in order to launch a new browser with a loaded landing page. This is necessary because the landing page is not stateless and requires several session parameters.

For an example stream, see how Kayak.com does it. 1. Go to Kayak.com and find a hotel in Chicago by registering on 1/21/2010 and checking on 1/22/2010 2. select the first result and select orbitz 3. The kayak will take you to the reservation page on orbitz. To do this, he must build a session, since orbitz does not have permanent links to the booking page.

Any thoughts on how to do this with Ruby?

+3
source share
4 answers

take a look at this library http://mechanize.rubyforge.org/

+6
source

I know this is old, but look at the library ruby Watir . It controls the browser and works with javascript

+2
source
+1

- , , . , , , , ​​ URL .

, - , , . -, , , , .

, Mechanize, , , , , , , html , , javascript ajax- .

+1

Source: https://habr.com/ru/post/1727385/


All Articles