作者:宝宝贝贝侠 | 来源:互联网 | 2023-08-26 12:55
Iwanttouseshoestobeabletodownloadthebodyofawebsitethatauserentersinanedit_line.
I want to use shoes to be able to download the body of a website that a user enters in an edit_line. How can I make this work? Can anyone help explain why the below code does not work? It just pops up a new window, and does not download the site from the text entered....
我想使用鞋子来下载用户在edit_line中输入的网站的正文。我怎样才能做到这一点?任何人都可以帮助解释为什么下面的代码不起作用?它只是弹出一个新窗口,不会从输入的文本中下载该网站....
Here's my code thus far:
到目前为止,这是我的代码:
Shoes.app do
stack (:left => 175, :top => 200) do
para "Enter a url:"
flow do
@url = edit_line
button "OK" do
window do
stack do
title "Searching site", :size => 16
@status = para "One moment..."
# Search site for query and print body
download @url.text do |site|
@status.text = "Body: " + site.response.body.inspect
end
end
end
end
end
end
end
1 个解决方案