Homework 13 - connicov1/saltedge_courses_2019 GitHub Wiki

Homework lesson 13

Gems needed for work:

require 'watir'
require 'nokogiri'

Your task is to write a script that contains class Kinopoisk that does all the following:

  1. Go to the kinopoisk.ru and search your favorite three movies using gem watir

  2. Parse HTML of the movie's main page(pic. A) using gem nokogiri

    RAAZ

    Example code: page = Nokogiri::HTML.parse(browser.html)

  3. Return an array of hashes with the following components:

    Name, Year, Genre, Country, Director, 5 main actors

Example output:

[  
   {  
      "Меч короля Артура":{  
         "year": "2017",
         "genre": "фэнтези",
         "country": "США",
         "director": "Гай Ричи",
         "5 main actors": [  
            "Чарли Ханнэм",
            "Астрид Берже-Фрисби",
            "Джуд Лоу",
            "Джимон Хонсу",
            "Эрик Бана"
         ]
      }
   }
]

As a bonus you can read and use Watir::Wait.until

Good luck!!!