Use nokogiri by "Post" method

Hi All,

Is there any way to use “post” to use nokogiri?
So, I want to copy the url address into an html input field and then press a button to get the details what i want to crawl

should it be something like this?

get ‘/’ do

mainpage = Nokogiri::HTML(open(‘https://www.transfermarkt.de/’))

@main = mainpage.css(‘.mostWanted’).css(‘.subline’).text.delete(“\n\t\”)

erb :players
end

post ‘/result’ do
player = Nokogiri::HTML(open(‘Marcelo - Spielerprofil 2023 | Transfermarkt’))

@team = player.css('.dataZusatzDaten').css('.hauptpunkt').text
@number = player.css('.dataHeader').css('.dataRN').text

erb :playersresult, :locals => { other: whatever }
end