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

  • Home
  • SEARCH
  • 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 8712217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:03:55+00:00 2026-06-13T05:03:55+00:00

Now I’m fetching data from another url… Here is my code: require ‘rubygems’ require

  • 0

Now I’m fetching data from another url…
Here is my code:

require 'rubygems'
    require 'nokogiri'

    html = page.body

    doc = Nokogiri::HTML(html)
    doc.encoding = 'utf-8'

    rows = doc.search('//table[@id = "MainContent_GridView1"]//tr')
      @details = rows.collect do |row|
          detail = {}
          [
            [:car, 'td[1]/text()'],
            [:article, 'td[2]/text()'],
            [:group, 'td[3]/text()'],
            [:price, 'td[4]/text()'],
          ].each do |name, xpath|
            detail[name] = row.at_xpath(xpath).to_s.strip
          end
          detail
      end
    @details  

I tried to do it via array, not a hash. But I get a lot of errors…
Are there any ideas?
I need it for another method…

also i set data (this result hash) to another car here:

oem_art = []
    @constr_num.each do |o|
      as_oem = get_from_as_oem(o.ARL_SEARCH_NUMBER)
      if as_oem.present?
        oem_art << as_oem
      end
    end    

    @oem_art = oem_art.to_a.uniq
  • 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-06-13T05:03:56+00:00Added an answer on June 13, 2026 at 5:03 am

    Do you just want to change a hash into an array? If so, just use the to_a method on your hash.

    hash = {:a => "something", :b => "something else"}
    array = hash.to_a
    array.inspect #=> [[:a, "something"], [:b, "something else"]]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

now i need to insert some data from the sqlserver into a word,i know
Now facebook require to have these options when you want to use bulit-in actions
Now I'm trying to display the result of consuming a webservice from one page
Now, bear in mind I'm just trying to ensure that the code works by
Now I am developing an Android application ,and I want to download data asynchronously
Now I find ploblem again. I want get data in db to listview. but
Now that FDT no longer supports fdt.launch.Application from AIR projects, how do you go
Now I have another problem with WCF server/client. I have a method: bool spr_wiersz(int
Now I'm wondering if is is safe to require files with only require($path) .
Now I initialize my OpenGL view by this code: glLoadIdentity(); glViewport(0, 0, w, h);

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.