Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1958454
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T08:19:29+00:00 2026-05-17T08:19:29+00:00

I am by no means a master with Ruby and am quite new to

  • 0

I am by no means a master with Ruby and am quite new to Scrubyt. I was just trying out some examples found on there wiki page. The example i was working on was getting the search results returned by Google when you search for ‘ruby’ and I had the idea of grabbing the URL of each result so I could go ahead and fetch that page as well. The problem is I don’t know how to grab the URL appropriately. This is my following code:

require 'rubygems'
require 'scrubyt'

google_data = Scrubyt::Extractor.define do
  fetch 'http://www.google.com/ncr'
  fill_textfield 'q','ruby'
  submit

  link_title "//a[@class='l']", :write_text => true do
    link_url
  end
end

google_data.to_xml.write($stdout, 1);

The code prints out the XML data appropriately (name and link) but how do I retrieve the link without the <link_url> tags that seems to get added to it (I tried to print out link_url and I noticed the tags are printed as well). Could I do something as simple as fetch link_url or is there a way of extracting the text from the xml content held in link_url?

This is some of the content that gets printed by the google_data.to_xml.write():

<root>
  <link_title>
    Ruby Programming Language
    <link_url>http://ruby-lang.org/</link_url>
  </link_title>
  <link_title>
    Download Ruby
    <link_url>http://www.ruby-lang.org/en/downloads/</link_url>
  </link_title>
  <link_title>
    Ruby - The Inspirational Weight Loss Journey on the Style Network ...
    <link_url>http://www.mystyle.com/mystyle/shows/ruby/index.jsp</link_url>
  </link_title>
  <link_title>
    Ruby (programming language) - Wikipedia, the free encyclopedia
    <link_url>http://en.wikipedia.org/wiki/Ruby_(programming_language)</link_url>
  </link_title>
</root>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T08:19:29+00:00Added an answer on May 17, 2026 at 8:19 am

    I’d think about alternatives. Scrubyt hasn’t been updated in a while, and the forums have been shut down.

    Mechanize can do what the Extractor does, Nokogiri can parse XML or HTML responses, and Builder can create XML (though it seems like you don’t really want XML).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there some means of querying the system tables to establish which tables are
Out of order execution in CPUs means that a CPU can reorder instructions to
By means of a regular expression and Greasemonkey I have an array of results
I'm by no means a sysadmin so please correct me if I'm wrong. I
I've seen various means of reading (and writing) Excel spreadsheets. For example: In .Net
I'm asking more about what this means to my code. I understand the concepts
Can someone explain what this means? int (*data[2])[2];
Can someone define what exactly 'POCO' means? I am encountering the term more and
Does anyone know what this means. Getting this in C# winforms applications: Not a
Anyone know what the C# M syntax means? var1 = Math.Ceiling(hours / (40.00M *

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.