Okay. I didn't knew Nokogiri is not a recommended way to parse html response in Metasploit modules. Outside Metasploit, Nokogiri seems to be popular to do the same task. Hence, I chose it here as well. Will update this section. Thanks.!