Watir在firefox“网络”选项卡中检查json - 解析

时间:2014-12-02 16:58:41

标签: ruby json parsing firefox watir

如果我问正确的问题,我不能100%肯定。 我去的网站使用了一个我需要访问的JSON字符串。我可以在Firefox"网络选项卡"中找到JSON字符串的位置。通过单击F12并选择" Network"标签。

所以我想我可以通过进入临时的互联网文件来访问该文件,但没有骰子。 我也认为watir可以通过自己访问临时的互联网文件,但我能找到的就是这个。

require 'watir-webdriver'

$browser = Watir::Browser.new
$browser.methods
=> [:driver, :wd, :inspect, :goto, :back, :forward, :url, :title, :close, :quit, :cookies, :name, :text, :html, :alert, :refresh, :wait, :ready_state, :status, :execute_script, :send_keys, :screenshot, :add_checker, :disable_checker, :run_checkers, :exist?, :exists?, :assert_exists, :reset!, :browser, :wait_until, :wait_while, :windows, :window, :element, :elements, :extract_selector, :a, :as, :abbr, :abbrs, :address, :addresses, :area, :areas, :article, :articles, :aside, :asides, :audio, :audios, :b, :bs, :base, :bases, :bdi, :bdis, :bdo, :bdos, :blockquote, :blockquotes, :body, :bodys, :br, :brs, :button, :buttons, :canvas, :canvases, :caption, :captions, :cite, :cites, :code, :codes, :col, :cols, :colgroup, :colgroups, :data, :datas, :datalist, :datalists, :dd, :dds, :del, :dels, :details, :detailses, :dfn, :dfns, :dialog, :dialogs, :div, :divs, :dl, :dls, :dt, :dts, :em, :ems, :embed, :embeds, :fieldset, :fieldsets, :figcaption, :figcaptions, :figure, :figures, :footer, :footers, :form, :forms, :frameset, :framesets, :h1, :h1s, :h2, :h2s, :h3, :h3s, :h4, :h4s, :h5, :h5s, :h6, :h6s, :head, :heads, :header, :headers, :hgroup, :hgroups, :hr, :hrs, :htmls, :i, :is, :iframe, :iframes, :img, :imgs, :input, :inputs, :ins, :inses, :kbd, :kbds, :keygen, :keygens, :label, :labels, :legend, :legends, :li, :lis, :main, :mains, :map, :maps, :mark, :marks, :menu, :menus, :menuitem, :menuitems, :meta, :metas, :meter, :meters, :nav, :navs, :noscript, :noscripts, :object, :objects, :ol, :ols, :optgroup, :optgroups, :option, :options, :output, :outputs, :p, :ps, :param, :params, :pre, :pres, :progress, :progresses, :q, :qs, :rp, :rps, :rt, :rts, :ruby, :rubies, :s, :ss, :samp, :samps, :script, :scripts, :section, :sections, :select, :selects, :small, :smalls, :source, :sources, :span, :spans, :strong, :strongs, :style, :styles, :sub, :subs, :summary, :summaries, :sup, :sups, :table, :tables, :tbody, :tbodys, :td, :tds, :template, :templates, :textarea, :textareas, :tfoot, :tfoots, :th, :ths, :thead, :theads, :time, :times, :titles, :tr, :trs, :track, :tracks, :u, :us, :ul, :uls, :var, :vars, :video, :videos, :wbr, :wbrs, :checkbox, :checkboxes, :file_field, :file_fields, :font, :fonts, :frame, :frames, :hidden, :hiddens, :image, :images, :link, :links, :radio, :radios, :select_list, :select_lists, :text_field, :text_fields, :field_set, :field_sets, :psych_to_yaml, :to_yaml, :to_yaml_properties, :dclone, :to_json, :nil?, :===, :=~, :!~, :eql?, :hash, :<=>, :class, :singleton_class, :clone, :dup, :taint, :tainted?, :untaint, :untrust, :untrusted?, :trust, :freeze, :frozen?, :to_s, :methods, :singleton_methods, :protected_methods, :private_methods, :public_methods, :instance_variables, :instance_variable_get, :instance_variable_set, :instance_variable_defined?, :remove_instance_variable, :instance_of?, :kind_of?, :is_a?, :tap, :send, :public_send, :respond_to?, :extend, :display, :method, :public_method, :define_singleton_method, :object_id, :to_enum, :enum_for, :==, :equal?, :!, :!=, :instance_eval, :instance_exec, :__send__, :__id__]

除了我需要访问的json临时文件外,有一种方法可以访问其他所有内容。 我还没有看到任何关于此的文档,因为我不确定我是否提出了正确的问题。

更新: 该方法是200 POST,扩展类型为json。

0 个答案:

没有答案