gpt4 book ai didi

ruby - 如何使用 Mechanize/Nokogiri 获取页面源

转载 作者:数据小太阳 更新时间:2023-10-29 06:29:10 25 4
gpt4 key购买 nike

我使用 Mechanize 登录到网页/servlet。

我有一个页面对象:

jobShortListPg = agent.get(addressOfPage)

当我使用时:

puts jobShortListPg

我得到了我不想要的页面的“Mechanize ”版本:

#<Mechanize::Page::Link "Home" "blahICScriptProgramName=WEBLIB_MENU.ISCRIPT3.FieldFormula.IScript_DrillDown&target=main0&Level=0&RL=&navc=3171">

如何获取页面的 HTML 源代码?

最佳答案

使用.body:

puts jobShortListPg.body

关于ruby - 如何使用 Mechanize/Nokogiri 获取页面源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6487101/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com