使用 ruby(clojure 或 javascript)保存输入网页
我有一个问题。我正在与一家食品供应商合作,我需要将每个订单的内容保存为 html。订单在单个页面上以链接形式列出,但这有两个困难
- 页面使用身份验证(需要提前登录)
- 这是真正的问题:页面使用大量 JavaScript。实际上,无需更改网址即可一切正常,因此我无法使用 wget 或 rio gem(网址不像
www.fooddoe.com/order
、www.fooddoe.com/order/1< /code> 等,但总是像
www.fooddoe.com/suplierx
)。
我认为 firewatir 将是一个不错的选择,但问题是我需要以类似于 html (包括图像)的格式保存页面。可以使用firewatir吗? clojure 或 javascript 中还有其他选项吗?
非常感谢!!
I've got a problem. I'm working with a food supplier and I need save the content of each order as html. Orders are listed on a single page as links, but this has 2 difficulties
- Page uses authentication (need to log me in in advance)
- This is the real problem: the page use a lot of javascript. Actually everything works without changing the web address so I can't use wget or rio gem (url not like
www.fooddoe.com/order
,www.fooddoe.com/order/1
, etc. but always likewww.fooddoe.com/suplierx
).
I think firewatir would be a good option but the problem is than I need to save the page in a format similar to html (including images). Is it possible using firewatir? Are there other options in clojure or javascript?
Thanks so much!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我必须读两遍你的问题才能理解你的意思。
根据示例中的网址,我假设这是您的供应商网页。所以恕我直言,最简单的方法是:
我认为这不是任何语言特有的问题。
I had to read your question twice to understand what you mean.
From web address from example I assume this is yours supplier web page. So IMHO the easiest way is:
And I think that this is not the question specific to any language.