Ticket #100 (new defect)
hpricot having problems with rubyforge tracker content
| Reported by: | zenspider | Owned by: | why |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | ext/hpricot_scan | Version: | |
| Keywords: | Cc: |
Description
{{{require 'rubygems' require 'mechanize' require 'yaml' require 'logger' require 'pp'
RUBYFORGE = 'http://rubyforge.org'
def rubyforge_login(username, password)
agent = WWW::Mechanize.new { |a| a.log = Logger.new(STDERR) } cookies = "rubyforge.yml" unless test ?f, cookies then
page = agent.get(RUBYFORGE) page = agent.click page.links.text(/Log In/) form = page.forms[1] form.form_loginname = username form.form_pw = password page = agent.submit(form, form.buttons.first) agent.cookie_jar.save_as cookies
else
agent.cookie_jar.load cookies
end agent
end
config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml"))) agent = rubyforge_login configusername?, configpassword?
ARGV.each do |project|
page = agent.get("#{RUBYFORGE}/projects/#{project}") page = agent.click page.links.text(/Bugs/) page = agent.click page.links.text(/Submit New/)
form = page.forms pp form
end}}}
run the script above with a rubyforge project name:
./blah.rb zentest
the last thing it prints out is a pp of all the forms on the "New Bug" page. You can see a detailed form for the search box... but the ticket submit box is nearly empty. I'm guessing it is the weird mix of table and form?
